J'ai écrit un petit algorithme de traitement d'image à l'aide de la bibliothèque CImg et l'ai regroupé dans une application de ligne de commande à l'aide de Visual C++ Express. Tout compilé sans erreur et s'est bien déroulé, jusqu'à ce que l'ingénieur en charge du projet décide qu'il voulait une interface graphique. Donc je suis allé à Qt et Qt créateur. L'interface graphique fonctionne bien par elle-même, mais tout l'enfer se déchaîne lorsque je déplace mon algorithme de traitement d'image.Erreurs de liaison dans Qt Creator 2.4.1 associé à la bibliothèque CImg
mainwindow.obj : error LNK2019: unresolved external
[email protected] referenced in function "char const * __cdecl
cimg_library::cimg::programfiles_path(char const * const,bool)"
([email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol
[email protected] referenced in function "public: static int __cdecl
cimg_library::CImgDisplay::screen_width(void)"
([email protected]@[email protected]@SAHXZ)
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: struct cimg_library::CImgDisplay & __thiscall
cimg_library::CImgDisplay::assign(void)"
([email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol
[email protected] referenced in function "public: void __thiscall
cimg_library::CImgDisplay::_desinit_fullscreen(void)"
([email protected]@[email protected]@QAEXXZ)
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: struct cimg_library::CImgDisplay & __thiscall
cimg_library::CImgDisplay::resize(int,int,bool)"
([email protected]@[email protected]@[email protected][email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: struct cimg_library::CImgDisplay & __thiscall
cimg_library::CImgDisplay::resize(int,int,bool)"
([email protected]@[email protected]@[email protected][email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: static unsigned long __stdcall
cimg_library::CImgDisplay::_events_thread(void *)"
([email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: static unsigned long __stdcall
cimg_library::CImgDisplay::_events_thread(void *)"
([email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: static unsigned long __stdcall
cimg_library::CImgDisplay::_events_thread(void *)"
([email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected] referenced
in function "public: static unsigned long __stdcall
cimg_library::CImgDisplay::_events_thread(void *)"
([email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol
[email protected] referenced in function "public: static unsigned long
__stdcall cimg_library::CImgDisplay::_events_thread(void *)"
([email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: static unsigned long __stdcall
cimg_library::CImgDisplay::_events_thread(void *)"
([email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: static unsigned long __stdcall
cimg_library::CImgDisplay::_events_thread(void *)"
([email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: static long __stdcall
cimg_library::CImgDisplay::_handle_events(struct HWND__ *,unsigned int,unsigned
int,long)" ([email protected]@[email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: static long __stdcall
cimg_library::CImgDisplay::_handle_events(struct HWND__ *,unsigned int,unsigned
int,long)" ([email protected]@[email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: static long __stdcall
cimg_library::CImgDisplay::_handle_events(struct HWND__ *,unsigned int,unsigned
int,long)" ([email protected]@[email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: static long __stdcall
cimg_library::CImgDisplay::_handle_events(struct HWND__ *,unsigned int,unsigned
int,long)" ([email protected]@[email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: static long __stdcall
cimg_library::CImgDisplay::_handle_events(struct HWND__ *,unsigned int,unsigned
int,long)" ([email protected]@[email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: static long __stdcall
cimg_library::CImgDisplay::_handle_events(struct HWND__ *,unsigned int,unsigned
int,long)" ([email protected]@[email protected]@[email protected]@[email protected])
mainwindow.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "public: struct cimg_library::CImgDisplay & __thiscall
cimg_library::CImgDisplay::paint(void)" ([email protected]@[email protected]@[email protected])
debug\final.exe : fatal error LNK1120: 20 unresolved externals
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
\BIN\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
\BIN\nmake.exe"' : return code '0x2'
Stop.
Mon problème maintenant, c'est que je ne sais pas pourquoi j'ai des problèmes de liaison. La bibliothèque CImg est un fichier H unique. Cela fait partie du projet et inclus. Je sais que Qt Creator a besoin de bibliothèques ajoutées au fichier de projet, mais qu'y a-t-il à ajouter? Ma bibliothèque est déjà répertoriée sous en-têtes.
Voici le fichier de projet.
QT += core gui
TARGET = final
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h \
C:/includes/CImg.h
FORMS += mainwindow.ui
INCLUDEPATH += C:\includes\
Merci pour l'aide, je suis avant tout un programmeur de systèmes embarqués et de travail hors de mon élément C et l'assemblage devient très frustrant.
Lorsque j'ajoute cette ligne, il essaie d'ajouter CIMG_LIB.lib, qui n'existe pas. La raison pour laquelle je suis si confus est le fait que CImg est contenu dans un seul fichier H. L'inclure devrait suffire. Cela passe par le préprocesseur, le compilateur et l'assembleur. Pourquoi lance-t-il le drapeau à l'éditeur de liens? –
Je suis désolé. Je ne sais pas Cimg est compilé avec votre code source, à la place d'une bibliothèque statique par linked. Le symbole non résolu est dans la bibliothèque Windows SDK. Réessayez ce 'LIBS + = -lAdvapi32 -lgdi32 -luser32 -lshell32'. –