Building wxWidgets 3.1.0 on CLion (Ubuntu)大厦的wxWidgets 3.0.3在克利翁程序(窗口)
Getting started with wxWidgets and CLion?
要了解这些问题,我可以在我的克利翁运行wxWidgets的GUI的 “Hello World” 程序使用的wxWidgets 3.0.3。
但我不能运行其他的wxWidgets样品一样一样way.These GUI样品中电网AUI色带前进GUI可以在我的代码:: Blocks的运行。
OS:服务器2016
克利翁:2017年2月3日
wxWidgets的:3.0.3
代码::块:16.01
MingW平台:x86_64-4.9.3-win32- seh-rt_v4-rev1
我的cmakelist.txt如下研究后在哪里(wxconfig.exe拷贝到cmake bin字典中):
修改cmakelist,
cmake_minimum_required(VERSION 3.9)
project(HelloTest)
#set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
find_package(wxWidgets REQUIRED
core base aui html jpeg tiff png gif zlib
# adv dbgrid expat html jpeg ribbon
# media mono net png propgrid qa
# regex ribbon richtext scintilla
# stc tiff webview xml xrc zlib
)
include(${wxWidgets_USE_FILE})
include_directories(D:/IDE/wxWidgets-3.0.3/samples)
set(SOURCE_FILES auidemo.cpp)
add_executable(HelloTest ${SOURCE_FILES})
target_link_libraries(HelloTest ${wxWidgets_LIBRARIES})
但我得到一些错误如下
CMakeFiles\HelloTest.dir/objects.a(auidemo.cpp.obj): In function `MyFrame::CreateGrid()':
D:/IdeaProjects/HelloTest/auidemo.cpp:1568: undefined reference to `wxGrid::CreateGrid(int, int, wxGrid::wxGridSelectionModes)'
CMakeFiles\HelloTest.dir/objects.a(auidemo.cpp.obj): In function `wxGrid::wxGrid(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)':
D:/IDE/wxWidgets-3.0.2/include/wx/generic/grid.h:944: undefined reference to `wxGrid::Init()'
D:/IDE/wxWidgets-3.0.2/include/wx/generic/grid.h:946: undefined reference to `wxGrid::Create(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
CMakeFiles\HelloTest.dir/objects.a(auidemo.cpp.obj):auidemo.cpp:(.rdata$.refptr.wxGridNameStr[.refptr.wxGridNameStr]+0x0): undefined reference to `wxGridNameStr'
CMakeFiles\HelloTest.dir/objects.a(auidemo.cpp.obj):auidemo.cpp:(.rdata$.refptr._ZTV6wxGrid[.refptr._ZTV6wxGrid]+0x0): undefined reference to `vtable for wxGrid'
D:/IDE/wxWidgets-3.0.2/lib/gcc_lib/libwxmsw30ud_aui.a(auilib_floatpane.o):floatpane.cpp:(.rdata$.refptr._ZN11wxMiniFrame12ms_classInfoE[.refptr._ZN11wxMiniFrame12ms_classInfoE]+0x0): undefined reference to `wxMiniFrame::ms_classInfo'
D:/IDE/wxWidgets-3.0.2/lib/gcc_lib/libwxmsw30ud_aui.a(auilib_floatpane.o):floatpane.cpp:(.rdata$.refptr._ZTV11wxMiniFrame[.refptr._ZTV11wxMiniFrame]+0x0): undefined reference to `vtable for wxMiniFrame'
D:/IDE/wxWidgets-3.0.2/lib/gcc_lib/libwxmsw30ud_html.a(htmllib_m_image.o): In function `wxHtmlImageCell::wxHtmlImageCell(wxHtmlWindowInterface*, wxFSFile*, int, bool, int, bool, double, int, wxString const&)':
C:\wxWidgets-3.0.2\build\msw/../../src/html/m_image.cpp:393: undefined reference to `wxGIFDecoder::wxGIFDecoder()'
C:\wxWidgets-3.0.2\build\msw/../../src/html/m_image.cpp:394: undefined reference to `wxGIFDecoder::LoadGIF(wxInputStream&)'
D:/IDE/wxWidgets-3.0.2/lib/gcc_lib/libwxmsw30ud_html.a(htmllib_htmlfilt.o):htmlfilt.cpp:(.rdata$.refptr._ZTV20wxStringOutputStream[.refptr._ZTV20wxStringOutputStream]+0x0): undefined reference to `vtable for wxStringOutputStream'
不使用CMake。只要在适当的目录下“make”即可。 wxWidgets不是为CMake制作的,希望永远不会。它使用不同的构建生成系统。 – Igor
只需使用'mingw32-make -f ...'如果构建32位库 – macroland
感谢所有人,我可以编译wxwidgets及其示例以使用“mingw32-make -f makefile.gcc ...”,但是我想知道如何在clion中跑步。 – andrew