Utiliser une librairie faite pour du C dans du C++???

cartouh Messages postés 24 Date d'inscription jeudi 27 février 2003 Statut Membre Dernière intervention 27 janvier 2004 - 17 juin 2003 à 17:29
gedge Messages postés 3 Date d'inscription mercredi 19 mai 2004 Statut Membre Dernière intervention 17 août 2004 - 17 août 2004 à 14:29
Bonjour,
j'essaie d'utiliser la librairie CPDFLib (http://www.fastio.com/)
je l'ai compilé sous visual comme ils disent dans la doc, j'obtient un .lib
je l'inclue ainsi que le .h

mai sqd j'utilise une fonction de c'te librairie j'ai plein d'erreurs de liens ke voila:

LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /INCREMENTAL:NO specification
LIBCD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in msvcrt.lib(MSVCRT.dll)
LIBCD.lib(dbgheap.obj) : error LNK2005: _calloc already defined in msvcrt.lib(MSVCRT.dll)
LIBCD.lib(dbgheap.obj) : error LNK2005: _realloc already defined in msvcrt.lib(MSVCRT.dll)
LIBCD.lib(dbgheap.obj) : error LNK2005: _free already defined in msvcrt.lib(MSVCRT.dll)
LIBCD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrt.lib(MSVCRT.dll)
LIBCD.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrt.lib(MSVCRT.dll)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrt.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrt.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrt.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrt.lib(cinitexe.obj)
LIBCD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrt.lib(MSVCRT.dll)
LINK : warning LNK4098: defaultlib "msvcrt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCD.lib(wwincrt0.obj) : error LNK2001: unresolved external symbol _wWinMain@16

bon, si j'utilise /nodedfaultlib, je me retrouve avec un (gros) tas d'erreurs!!!!

l'erreur de link 2005:
The most common cause of this error is accidentally linking with both the single-threaded and multithreaded libraries. Ensure that the application project file includes only the appropriate libraries and that any third-party libraries have appropriately created single-threaded or multithreaded versions.

mais je ne sais pas...
je pense que c'est pas du multithreading mon appli (MFC) et la lib j'en sais rien....

comment faire?

une idée?

j'ai fé qque chose de pas bien?

a++ les gens...
;)

4 réponses

cartouh Messages postés 24 Date d'inscription jeudi 27 février 2003 Statut Membre Dernière intervention 27 janvier 2004
17 juin 2003 à 17:34
ClibPDF is now thread-safe for use in multi-threaded applications.

bah, mon appli est single-threaded, comment la passer en multi-threaded??

ca doit etre ca le probleme...

a++ les gens...
;)
0
cs_payen Messages postés 252 Date d'inscription mercredi 25 octobre 2000 Statut Membre Dernière intervention 1 mai 2005
17 juin 2003 à 23:08
sous VC++, dans les settings du projet : Alt+F7, onglet C/C++, Category : Code Generation, et puis Use Run Time Librairy pour changer ...
0
cartouh Messages postés 24 Date d'inscription jeudi 27 février 2003 Statut Membre Dernière intervention 27 janvier 2004
18 juin 2003 à 10:13
ben non, mon appli est multi threaded DLL

et qd je passe en multithreaded ou single threaded j'ai ca:

C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxver_.h(130) : fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
DeleteTagDlg.cpp
C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxver_.h(130) : fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
ParamDlg.cpp
C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxver_.h(130) : fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
ParamLecteursDlg.cpp
C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxver_.h(130) : fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
ReadTagDlg.cpp
C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxver_.h(130) : fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
SimpleApp.cpp
C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxver_.h(130) : fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
SimpleFrame.cpp
C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxver_.h(130) : fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
Error executing cl.exe.

je sais pas trop d'ou ca viens...
comme c'est une appli quie je modifie...
je ne sais pas trtop ce que le mec à fé avant!

a++ les gens...
;)
0
gedge Messages postés 3 Date d'inscription mercredi 19 mai 2004 Statut Membre Dernière intervention 17 août 2004
17 août 2004 à 14:29
Salut

J'ai le même problème que toi. Tu as trouvé une solution finalement ?

A+
Gérald
0
Rejoignez-nous