Re: [問題] Qt+vc2010 about Qt Designer

看板C_and_CPP作者時間12年前 (2012/02/13 23:44), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串3/3 (看更多)
小弟 我用Qt Creator 4.8 + OpenCV 2.3.1 .pro的設定如下 照著OpenCV 2 Computer Vision Application Programming Cookbook 這本原文書打的 QT += core QT -= gui TARGET = myQtConsoleProject CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp INCLUDEPATH += C:\OpenCV2.3.1\include\ LIBS += -LC:\OpenCV2.3.1\lib \ -lopencv_core231 \ -lopencv_highgui231 \ -lopencv_imgproc231 \ -lopencv_features2d231 \ -lopencv_calib3d231 錯誤訊息如下 23:37:17: Running build steps for project myQtConsoleProject... 23:37:17: Configuration unchanged, skipping qmake step. 23:37:17: Starting: "C:\QtSDK\QtCreator\bin\jom.exe" main.obj : error LNK2019: unresolved external symbol "int __cdecl cv::waitKey(int)" (?waitKey@cv@@YAHH@Z) referenced in function _main main.obj : error LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" (?imshow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV_InputArray@1@@Z) referenced in function _main main.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::_InputArray::_InputArray(class cv::Mat const &)" (??0_InputArray@cv@@QAE@ABVMat@1@@Z) referenced in function _main main.obj : error LNK2019: unresolved external symbol "void __cdecl cv::namedWindow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?namedWindow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function _main main.obj : error LNK2019: unresolved external symbol "class cv::Mat __cdecl cv::imread(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?imread@cv@@YA?AVMat@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function _main main.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPAX@Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@QAE@XZ) main.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QAEXXZ) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release@Mat@cv@@QAEXXZ) debug\myQtConsoleProject.exe : fatal error LNK1120: 7 unresolved externals link /LIBPATH:"c:\QtSDK\Desktop\Qt\4.8.0\msvc2010\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST /MANIFESTFILE:"debug\myQtConsoleProject.intermediate.manifest" /OUT:debug\myQtConsoleProject.exe @C:\Users\twofish\AppData\Local\Temp\myQtConsoleProject.exe.2620.0.jom C:\QtSDK\QtCreator\bin\jom.exe -f Makefile.Debug jom: C:\Users\twofish\Desktop\Qt Project\myQtConsoleProject-build-desktop-Qt_4_8_0_for_Desktop_-_MSVC2010__Qt_SDK__Debug\Makefile.Debug [debug\myQtConsoleProject.exe] Error 1120 jom 1.0.8 - empower your cores jom: C:\Users\twofish\Desktop\Qt Project\myQtConsoleProject-build-desktop-Qt_4_8_0_for_Desktop_-_MSVC2010__Qt_SDK__Debug\Makefile [debug] Error 2 23:37:17: The process "C:\QtSDK\QtCreator\bin\jom.exe" exited with code 2. Error while building project myQtConsoleProject (target: Desktop) When executing build step 'Make' -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.120.14.130

02/14 00:53, , 1F
LIBS+=C:/OpenCV2.3.1/lib/opencv_core231.lib 這樣試試?
02/14 00:53, 1F

02/14 15:05, , 2F
看起來都是Linking Error
02/14 15:05, 2F
文章代碼(AID): #1FEI_I1u (C_and_CPP)
文章代碼(AID): #1FEI_I1u (C_and_CPP)