[wxVTK] Installing wxVTK
Brought to you by:
malat
|
From: Andrey S. <sky...@gm...> - 2008-12-23 08:22:34
|
Hi all, I am having some trouble linking the samples provided with wxVTK. Could somebody please point me to a reference that explains: - how one should install wxWidgets in order for it to work with wxVTK - how one should install VTK to have it work with wxVTK - how to compile and link the sample programs provided with wxVTK using cmake - what wxWidgets_CONFIG_EXECUTABLE and wxWidgets_wxrc_EXECUTABLE are - how to have cmake find those directories automatically For anyone who wants to know more about what I did specifically to come up with these questions, a detailed description is below. - Andrey Details: ----------------------------------------------------- I'm running cygwin 1.5.25 on Windows XP. I'm using - g++ version 3.4.4 (sygming special, gdc 0.12, using dmd 0.125) - cmake version 2.6-patch 2 - VTK 5.2.0 - wxWidgets version 2.8 VTK Setup ----------------------------------------------------- I installed VTK on 10/29/2008. I am able to run the sample programs that came with it. wxWidgets Setup ----------------------------------------------------- I acquired and compiled wxWidgets following directions on http://wiki.wxwidgets.org/Cygwin I entered this in the shell (following the "To get an executable independent of Cygwin DLL" directions) $ cvs -d :pserver:an...@cv...:/pack/cvsroots/wxwidgets checkout -r WX_2_8_BRANCH wxMSW $ cd wxWidgets $ export CFLAGS=-mno-cygwin $ export CPPFLAGS=-mno-cygwin $ export CXXFLAGS=-mno-cygwin $ export LDFLAGS="-mno-cygwin -mwindows" $ ./configure --with-msw --enable-debug --enable-debug_gdb --disable-shared --with-libjpeg=builtin --disable-precomp-headers --without-expat $ make I downloaded the provided hworld.cpp and successfully generated the GUI. wxVTK Setup ----------------------------------------------------- I then proceeded to try to get wxVTK to work. I downloaded wxVTK from http://sourceforge.net/project/showfiles.php?group_id=114757&package_id=124328&release_id=603693 and extracted it to ~/wxVTK I then copied all the files needed for compiling the samples to a new directory and did an out of source build using cmake $ mkdir ~/test $ cd ~/test $ mkdir src $ mkdir bin $ cd ~/wxVTK $ cp -r src/ Sample/ CMakeLists.txt ~/test/src $ cd ~/test/bin $ ccmake ../src This lead to the first stopping point. There were two variables: wxWidgets_CONFIG_EXECUTABLE wxWidgets_wxrc_EXECUTABLE That are not described or explained anywhere (google or otherwise). I ended up looking through the FindwxWidgets.cmake module in both ~/wxVTK/Modules /usr/share/cmake-2.6.2/Modules The one that came with cmake had a little bit of an explanation as to what the parameters were. I ended up running make install on both vtk and wxWidgets so that they would be in directories the script would look in (on the path). In the end, I got that wxWidgets_CONFIG_EXECUTABLE = /usr/local/bin/wx-config which is a pointer to usr/ocal/lib/wx/config/msw-ansi-debug-static-2.8 - what is this and why is it needed for using wxWidgets? Getting a value for wxWidgets_wxrc_EXECUTABLE was harder. Using FindwxWidgets.cmake that came with wxVTK, it just kept telling me "Cannot find wxWidgets libraries and/or header files." Using the FindwxWidgets.cmake that came with cmake accepted /usr/local/lib/wx, /usr/local/include/wx-2.8/wx, /usr/local/include/wx-2.8, it doesn't seem to care what you put there. I expect that this is where my problems are coming from. In the end I kept wxWidgets_wxrc_EXECUTABLE = /usr/local/include/wx-2.8 I generated the make file and ran make. It wxImagePlaneWidgets.cxx and then wxVTKRenderWindowInteractor.cxx, then tried to link them, and spewed a lot of errors concerning ___assert and ___errno. Unfortunately I didn't save the errors and have recompiled wxWindows since then and don't want to spend a third hour recompiling that library. Upon examining wxVTKRenderWindowInteractor.cxx I saw that it used <assert.h> and the assert macro. It seemed like the linker wasn't linking libc because I compiled wxWidgets with -mno-cygwin, thus leading to ___assert and ___errno not being found when linking. I recompiled wxWidgets without the -mno-cygwin flags. I used these commands in the wxWidgets directory: $ ./configure --with-msw --enable-debug --enable-debug_gdb --disable-shared --with-libjpeg=builtin $ make The ___assert and ___errno errors promptly disappeared, but the linker is still complaining. I tried building the samples again using the same cmake configuration as before and I am currently received the warning /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: warning: auto-importing has been activated without --enable-auto-import specified on the command line. This should work unless it involves constant data structures referencing symbols from auto Seems like it didn't work... The full error message is below: $ make Scanning dependencies of target wxImagePlaneWidget [ 10%] Building CXX object CMakeFiles/wxImagePlaneWidget.dir/Sample/wxImagePlaneWidget.cxx.o [ 20%] Building CXX object CMakeFiles/wxImagePlaneWidget.dir/src/wxVTKRenderWindowInteractor.cxx.o Linking CXX executable bin/wxImagePlaneWidget.exe /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: warning: auto-importing has been activated without --enable-auto-import specified on the command line. This should work unless it involves constant data structures referencing symbols from auto -imported DLLs./usr/local/lib/libwx_mswd_core-2.8.a(corelib_window.o):/usr/src/wxWidgets/. /src/msw/window.cpp:1340: undefined reference to `wxSystemOptions::GetOptionInt(wxString const&)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_window.o):/usr/src/wxWidgets/./src/msw/window.cpp:3956: undefined reference to `_wxEVT_POWER_SUSPENDING' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_window.o):/usr/src/wxWidgets/./src/msw/window.cpp:3960: undefined reference to `_wxEVT_POWER_SUSPEND_CANCEL' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_window.o):/usr/src/wxWidgets/./src/msw/window.cpp:3964: undefined reference to `_wxEVT_POWER_SUSPENDED' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_window.o):/usr/src/wxWidgets/./src/msw/window.cpp:3971: undefined reference to `_wxEVT_POWER_RESUME' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_wincmn.o): In function `wxWindowBase':/usr/src/wxWidgets/./src/common/wincmn.cpp:212: undefined reference to `wxSystemOptions::HasOption(wxString const&)' /usr/src/wxWidgets/./src/common/wincmn.cpp:214: undefined reference to `wxSystemOptions::GetOptionInt(wxString const&)' /usr/src/wxWidgets/./src/common/wincmn.cpp:212: undefined reference to `wxSystemOptions::HasOption(wxString const&)' /usr/src/wxWidgets/./src/common/wincmn.cpp:214: undefined reference to `wxSystemOptions::GetOptionInt(wxString const&)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_colourcmn.o): In function `_ZlsR9wxVariantRK8wxColour': /usr/src/wxWidgets/./src/common/colourcmn.cpp:141: undefined reference to `wxVariant::SetData(wxVariantData*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_colourcmn.o): In function `__static_initialization_and_destruction_0': /usr/src/wxWidgets/./src/common/colourcmn.cpp:29: undefined reference to `wxVariantData::ms_classInfo' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_colourcmn.o): In function `~wxVariantData': /usr/src/wxWidgets/./include/wx/variant.h:99: undefined reference to `vtable for wxVariantData' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_colourcmn.o): In function `wxVariantData': /usr/src/wxWidgets/./include/wx/variant.h:68: undefined reference to `vtable for wxVariantData' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_font.o):/usr/src/wxWidgets/./src/msw/font.cpp:431: undefined reference to `wxSystemOptions::GetOptionInt(wxString const&)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_dc.o):/usr/src/wxWidgets/./src/msw/dc.cpp:1213: undefined reference to `wxSystemOptions::GetOptionInt(wxString const&)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_dc.o):/usr/src/wxWidgets/./src/msw/dc.cpp:2138: undefined reference to `wxSystemOptions::GetOptionInt(wxString const&)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_tbar95.o):/usr/src/wxWidgets/./src/msw/tbar95.cpp:570: undefined reference to `wxSystemOptions::HasOption(wxString const&)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_tbar95.o):/usr/src/wxWidgets/./src/msw/tbar95.cpp:570: undefined reference to `wxSystemOptions::GetOptionInt(wxString const&)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_statbox.o):/usr/src/wxWidgets/./src/msw/statbox.cpp:211: undefined reference to `wxSystemOptions::GetOptionInt(wxString const&)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_statbox.o):/usr/src/wxWidgets/./include/wx/sysopt.h:40: undefined reference to `wxSystemOptions::HasOption(wxString const&)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_statbox.o):/usr/src/wxWidgets/./include/wx/sysopt.h:40: undefined reference to `wxSystemOptions::GetOptionInt(wxString const&)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o): In function `~wxSizer':/usr/src/wxWidgets/./src/common/sizer.cpp:509: undefined reference to `wxClientDataContainer::~wxClientDataContainer()' /usr/src/wxWidgets/./src/common/sizer.cpp:509: undefined reference to `wxClientDataContainer::~wxClientDataContainer()' /usr/src/wxWidgets/./src/common/sizer.cpp:509: undefined reference to `wxClientDataContainer::~wxClientDataContainer()' /usr/src/wxWidgets/./src/common/sizer.cpp:509: undefined reference to `wxClientDataContainer::~wxClientDataContainer()' /usr/src/wxWidgets/./src/common/sizer.cpp:509: undefined reference to `wxClientDataContainer::~wxClientDataContainer()' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):/usr/src/wxWidgets/./src/common/sizer.cpp:509: more undefined references to `wxClientDataContainer::~wxClientDataContainer()' follow /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o): In function `wxSizer': /usr/src/wxWidgets/./include/wx/sizer.h:410: undefined reference to `wxClientDataContainer::wxClientDataContainer()' /usr/src/wxWidgets/./include/wx/sizer.h:410: undefined reference to `wxClientDataContainer::~wxClientDataContainer()' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV16wxStaticBoxSizer[vtable for wxStaticBoxSizer]+0x7c): undefined reference to `wxClientDataContainer::DoSetClientObject(wxClientData*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV16wxStaticBoxSizer[vtable for wxStaticBoxSizer]+0x80): undefined reference to `wxClientDataContainer::DoGetClientObject() const' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV16wxStaticBoxSizer[vtable for wxStaticBoxSizer]+0x84): undefined reference to `wxClientDataContainer::DoSetClientData(void*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV16wxStaticBoxSizer[vtable for wxStaticBoxSizer]+0x88): undefined reference to `wxClientDataContainer::DoGetClientData() const' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV10wxBoxSizer[vtable for wxBoxSizer]+0x7c): undefined reference to `wxClientDataContainer::DoSetClientObject(wxClientData*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV10wxBoxSizer[vtable for wxBoxSizer]+0x80): undefined reference to `wxClientDataContainer::DoGetClientObject() const' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV10wxBoxSizer[vtable for wxBoxSizer]+0x84): undefined reference to `wxClientDataContainer::DoSetClientData(void*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV10wxBoxSizer[vtable for wxBoxSizer]+0x88): undefined reference to `wxClientDataContainer::DoGetClientData() const' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV15wxFlexGridSizer[vtable for wxFlexGridSizer]+0x7c): undefined reference to `wxClientDataContainer::DoSetClientObject(wxClientData*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV15wxFlexGridSizer[vtable for wxFlexGridSizer]+0x80): undefined reference to `wxClientDataContainer::DoGetClientObject() const' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV15wxFlexGridSizer[vtable for wxFlexGridSizer]+0x84): undefined reference to `wxClientDataContainer::DoSetClientData(void*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV15wxFlexGridSizer[vtable for wxFlexGridSizer]+0x88): undefined reference to `wxClientDataContainer::DoGetClientData() const' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV11wxGridSizer[vtable for wxGridSizer]+0x7c): undefined reference to `wxClientDataContainer::DoSetClientObject(wxClientData*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV11wxGridSizer[vtable for wxGridSizer]+0x80): undefined reference to `wxClientDataContainer::DoGetClientObject() const' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV11wxGridSizer[vtable for wxGridSizer]+0x84): undefined reference to `wxClientDataContainer::DoSetClientData(void*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV11wxGridSizer[vtable for wxGridSizer]+0x88): undefined reference to `wxClientDataContainer::DoGetClientData() const' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV7wxSizer[vtable for wxSizer]+0x7c): undefined reference to `wxClientDataContainer::DoSetClientObject(wxClientData*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV7wxSizer[vtable for wxSizer]+0x80): undefined reference to `wxClientDataContainer::DoGetClientObject() const' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV7wxSizer[vtable for wxSizer]+0x84): undefined reference to `wxClientDataContainer::DoSetClientData(void*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV7wxSizer[vtable for wxSizer]+0x88): undefined reference to `wxClientDataContainer::DoGetClientData() const' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV22wxStdDialogButtonSizer[vtable for wxStdDialogButtonSizer]+0x7c): undefined reference to `wxClientDataContainer::DoSetClientObject(wxClientData*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV22wxStdDialogButtonSizer[vtable for wxStdDialogButtonSizer]+0x80): undefined reference to `wxClientDataContainer::DoGetClientObject() const' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV22wxStdDialogButtonSizer[vtable for wxStdDialogButtonSizer]+0x84): undefined reference to `wxClientDataContainer::DoSetClientData(void*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_sizer.o):sizer.cpp:(.rdata$_ZTV22wxStdDialogButtonSizer[vtable for wxStdDialogButtonSizer]+0x88): undefined reference to `wxClientDataContainer::DoGetClientData() const' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_bmpbase.o): In function `_ZlsR9wxVariantRK8wxBitmap': /usr/src/wxWidgets/./src/common/bmpbase.cpp:141: undefined reference to `wxVariant::SetData(wxVariantData*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_bmpbase.o): In function `_ZlsR9wxVariantRK6wxIcon': /usr/src/wxWidgets/./src/common/bmpbase.cpp:32: undefined reference to `wxVariant::SetData(wxVariantData*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_bmpbase.o): In function `__static_initialization_and_destruction_0': /usr/src/wxWidgets/./src/common/bmpbase.cpp:31: undefined reference to `wxVariantData::ms_classInfo' /usr/src/wxWidgets/./src/common/bmpbase.cpp:32: undefined reference to `wxVariantData::ms_classInfo' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_image.o): In function `_ZlsR9wxVariantRK7wxImage': /usr/src/wxWidgets/./src/common/image.cpp:141: undefined reference to `wxVariant::SetData(wxVariantData*)' /usr/local/lib/libwx_mswd_core-2.8.a(corelib_image.o): In function `__static_initialization_and_destruction_0': /usr/src/wxWidgets/./src/common/image.cpp:52: undefined reference to `wxVariantData::ms_classInfo' Info: resolving __timezone by linking to __imp___timezone (auto-import) collect2: ld returned 1 exit status make[2]: *** [bin/wxImagePlaneWidget.exe] Error 1 make[1]: *** [CMakeFiles/wxImagePlaneWidget.dir/all] Error 2 make: *** [all] Error 2 |