Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 在Windows中使用cmake将wxWidgets添加到项目_C++_Linker_Cmake_Wxwidgets - Fatal编程技术网

C++ 在Windows中使用cmake将wxWidgets添加到项目

C++ 在Windows中使用cmake将wxWidgets添加到项目,c++,linker,cmake,wxwidgets,C++,Linker,Cmake,Wxwidgets,我正在尝试使用cmake将wxWidgets添加到我的项目中 在cmake中,我有: #wxWidgets set(wxWidgets_CONFIGURATION mswu) find_package(wxWidgets COMPONENTS core base REQUIRED) include(${wxWidgets_USE_FILE}) target_link_libraries(MyProject ${OpenCV_LIBS} ${wxWidgets_LIBRARIES

我正在尝试使用cmake将wxWidgets添加到我的项目中

在cmake中,我有:

#wxWidgets
set(wxWidgets_CONFIGURATION mswu)
find_package(wxWidgets COMPONENTS core base REQUIRED)
include(${wxWidgets_USE_FILE})
target_link_libraries(MyProject
    ${OpenCV_LIBS}
    ${wxWidgets_LIBRARIES}
    ${Boost_LIBRARIES})
对于我在cmake的项目,我有:

#wxWidgets
set(wxWidgets_CONFIGURATION mswu)
find_package(wxWidgets COMPONENTS core base REQUIRED)
include(${wxWidgets_USE_FILE})
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   

问题是什么?如何解决?wxSplashScreen是的一部分,因此您需要告诉cmake链接到该问题以及core和base:

find_package(wxWidgets COMPONENTS core base adv REQUIRED)