ScripteurPermanent
Messages postés18Date d'inscriptionmardi 7 novembre 2000StatutMembreDernière intervention 9 avril 2007
-
9 avril 2007 à 19:53
peck0
Messages postés2Date d'inscriptionmardi 7 juin 2011StatutMembreDernière intervention 6 juin 2011
-
6 juin 2011 à 22:01
Bonjour,
Voilà, je cherche à piloter mon port Imprimante en C, pour cela j'ai trouvé la librairie WinIo (
) mais je n'arrive pas à l'installer.
J'ai suivi ce que dit l'auteur:
In order to use WinIo in a Visual C++ application, you should take the
following steps:
<ol><li>Place winio.dll, winio.vxd and winio.sys in the directory where your
application's executable file resides.
</li><li>Add winio.lib to your project file by right clicking on the project name in
the Visual C++ workview pane and selecting "Add Files to Project...".
</li><li>Add the #include "winio.h" statement to your source file.
</li><li>Call [InitializeWinIo.htm InitializeWinIo].
</li><li>Call the library's functions to access I/O ports and physical memory.
</li><li>Call [ShutdownWinIo.htm ShutdownWinIo]. </li></ol>
Seulement quand je compile mon code, il me met toujours les mêmes trois erreures:
.objs\main.o:main.cpp:(.text+0x2b): undefined reference to `_imp__InitializeWinIo@0'
.objs\main.o:main.cpp:(.text+0x49): undefined reference to `_imp__SetPortVal@12'
.objs\main.o:main.cpp:(.text+0x53): undefined reference to `_imp__ShutdownWinIo@0'
Si quelqu'un pouvait m'aider, ça serait très gentil car je galère depuis pas mal de temps !
ScripteurPermanent
Messages postés18Date d'inscriptionmardi 7 novembre 2000StatutMembreDernière intervention 9 avril 2007 9 avril 2007 à 20:21
Enfait, j'ai essayé sous Code::block et sous VC++ et ils me mettent la même erreur tous les deux et j'utilise VC++ 6.0
(et puis j'ai suivis à la lettre - enfin je pense ^^)
Je vis pour programmer mais j'aimerais programmer pour vivre aussi.
pyros18
Messages postés1Date d'inscriptionmercredi 13 juin 2007StatutMembreDernière intervention13 juin 2007 13 juin 2007 à 19:20
Bonjour,
D'apres la faq de www.internals.com, les .lib déconnes un peu. La solution est d'utiliser les fonction LoadLibrary et GetProcAddress pour charger la dll. J'ai pagayer toute l'aprem midi pour comprendre vaguement comment ça marche (merci le msdn windows et mon ami breton préféré ^^). et j'ai réussi à pondre ceci (WinIo.dll doit ètre dans le repertoire de l'executable) :
HMODULE hLib= NULL;
FARPROC InitializeWinIo=NULL;
on charge la dll
hLib=LoadLibrary("WinIo.dll");
on dit que la fonction InitializeWinIo est en fait la fonction InitializeWinIo contenu dans la dll hLib (donc WinIo.dll) :
InitializeWinIo = GetProcAddress(hLib, "InitializeWinIo");
Pour chaque fonction utilisé, il faudra mettre une ligne du type :
fonction = GetProcAddresse(hLib, "fonction");
Maintenant, ça compil et ça link. J'ai pas encore put tester si ça marchait bien, mais ça a l'air en bonne voix.
@+
Vous n’avez pas trouvé la réponse que vous recherchez ?