Building wxWidgets 3.1.0 on CLion (Ubuntu)
Getting started with wxWidgets and CLion?
To learn these question,I can run Wxwidgets GUI "hello world" program in my clion to use wxwidgets 3.0.3.
But I can't run other wxwidgets sample like as grid aui ribbon advance GUI in the same way.These GUI sample can be run at my CODE::BLOCKS.
OS:Server 2016
clion:2017.2.3
wxwidgets:3.0.3
code::block:16.01
MingW: x86_64-4.9.3-win32-seh-rt_v4-rev1
My cmakelist.txt as following after study every where (wxconfig.exe have copy to the cmake bin dictionary) :
Modify the 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})
But I get some error as following
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'