【发布时间】:2014-11-13 16:33:22
【问题描述】:
我正在尝试使用 cmake 将 wxWidgets 添加到我的项目中。
在 cmake 中我有:
#wxWidgets
set(wxWidgets_CONFIGURATION mswu)
find_package(wxWidgets COMPONENTS core base REQUIRED)
include(${wxWidgets_USE_FILE})
对于我在 cmake 中的项目,我有:
target_link_libraries(MyProject
${OpenCV_LIBS}
${wxWidgets_LIBRARIES}
${Boost_LIBRARIES})
然后使用以下命令运行 cmake:
cmake -G "Visual Studio 11 Win64" ..
但是当我在 Visual Studio 中编译生成的项目时,出现链接错误:
unresolved external symbol "public: __cdecl wxSplashScreen::wxSplashScreen(class wxBitmap const &,long,int,class wxWindow *,int,class wxPoint const &,class wxSize const &,long)" (??0wxSplashScreen@@QEAA@AEBVwxBitmap@@JHPEAVwxWindow@@HAEBVwxPoint@@AEBVwxSize@@J@Z) referenced in function "public: __cdecl MainWindow::MainWindow(void)" (??0MainWindow@@QEAA@XZ)
unresolved external symbol "public: virtual __cdecl wxSplashScreen::~wxSplashScreen(void)" (??1wxSplashScreen@@UEAA@XZ) referenced in function "public: __cdecl MainWindow::MainWindow(void)" (??0MainWindow@@QEAA@XZ)
unresolved external symbol main referenced in function __tmainCRTStartup
问题是什么,我该如何解决?
【问题讨论】:
标签: c++ linker cmake wxwidgets