CImg 라이브러리를 사용하여 작은 이미지 처리 알고리즘을 작성하고 Visual C++ Express를 사용하는 명령 줄 응용 프로그램에 번들로 제공했습니다. 프로젝트를 담당하는 엔지니어가 GUI를 원한다고 결정할 때까지 모든 것이 오류없이 컴파일되고 잘 돌아갔습니다. 그래서 나는 Qt와 Qt 제작자에게 갔다. GUI는 자체적으로 정상적으로 작동하지만 이미지 처리 알고리즘을 이동할 때 모든 지옥이 느슨해집니다.CImg 라이브러리와 연결된 Qt Creator 2.4.1의 링커 오류
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 __imp__Get[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.
내 문제는 지금 왜 링커 문제가 있는지 잘 모르겠다는 것입니다. CImg 라이브러리는 단일 H 파일입니다. 그것은 프로젝트의 일부이며 포함되어 있습니다. Qt Creator가 프로젝트 파일에 추가 된 라이브러리를 필요로한다는 것을 알고 있습니다 만, 추가 할 부분은 무엇입니까? 내 라이브러리는 이미 헤더 아래에 나열되어 있습니다.
다음은 프로젝트 파일입니다.
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\
덕분에 도움, 나는 주로 임베디드 시스템 프로그래머 해요, 내 C 및 어셈블리 요소에서 작업하는 것은 매우 실망지고 있습니다.
해당 행을 추가하면 존재하지 않는 CIMG_LIB.lib를 추가하려고 시도합니다. 내가 이것 때문에 혼란스러워하는 이유는 CImg이 하나의 H 파일에 포함되어 있기 때문입니다. 그것을 포함하면 충분합니다. 전처리 기, 컴파일러 및 어셈블러를 통해이 작업을 수행합니다. 왜 링커에서 깃발을 던지고있는거야? –
죄송합니다. Cimg가 링크로 정적 라이브러리로 대신 소스 코드로 컴파일되었는지는 모르겠다. 해결되지 않은 기호는 Windows SDK 라이브러리에 있습니다. 이'LIBS + = -lAdvapi32 -lgdi32 -luser32 -lshell32'를 다시 시도하십시오. –