[wxVTK] Undefined reference using CygWin+VTK+wxWidgets+wxVTK
Brought to you by:
malat
From: Jonas W. <jon...@gm...> - 2006-07-28 22:11:07
|
I'm trying to compile the wxVTK package, but gets a linking error when linking Sample.exe when running make. This is my configuration: - VTK 4.4.2 compiled and installed in four different configurations (debug, debug+static, release and release+static) in /usr/local/ - wxWidgets 2.6.3 alsp compiled and installed in four different configurations (debug, debug+static, release and release+static) in /usr/local/ - ccmake version 2.2-patch 3 - All using the latest CygWin in WindowsXP I get five (one for each sample in wxVTK) warnings when generating in ccmake: Warning: Ignoring path found in link libraries for target: Sample, the path is : /usr/local/lib. Expected a library name or full path to a library name= . It all compiles but when linking Sample.exe I get a lot of 'undefined reference' (one of them is 'undefined reference to `wxClassInfo::Register()=B4). I've tried forcing the linker flags to the output of `wx-config --libs=B4 w= ith no success: CMAKE_EXE_LINKER_FLAGS:STRING=3D-L/usr/local/lib -lwx_msw_xrc-2.6 -lwx_msw_= qa- 2.6 -lwx_msw_html-2.6 -lwx_msw_adv-2.6 -lwx_msw_core-2.6 -lwx_base_xml-2.6-lwx_base_net- 2.6 -lwx_base-2.6 The only progress I could make was to add the linking info directly into CMakeFiles/Sample.dir/build.make but this isn't nice coding: bin/Sample.exe: CMakeFiles/Sample.dir/build.make @echo "Linking CXX executable bin/Sample.exe" $(CMAKE_COMMAND) -E remove -f bin/Sample.exe c++ -Wno-deprecated -mwin32 -L/usr/local/lib -lwx_msw_xrc-2.6-lwx_msw_qa- 2.6 -lwx_msw_html-2.6 -lwx_msw_adv-2.6 -lwx_msw_core-2.6 -lwx_base_xml-2.6-lwx_base_net- 2.6 -lwx_base-2.6 $(Sample_OBJECTS) $(Sample_EXTERNAL_OBJECTS) -o bin/Sample.exe -L/cygdrive/c/apps/wxVTK/bin -L/usr/lib/w32api -L/usr/local/lib/vtk -lvtkIO -lvtkHybrid -lvtkCommon -lvtkGraphics -lvtkRendering -lcomctl32 -lrpcrt4 -lwsock32 -lopengl32 -lglu32 -lvtkGraphics -lvtkImaging -lvtkIO -lvtkFiltering -lvtkCommon -lpthread -lgdi32 -lm -lvtkDICOMParser -lvtkpng -lvtktiff -lvtkzlib -lvtkjpeg -lvtkexpat -lvtkftgl -lvtkfreetype -lglu32 -lopengl32 So my final question is; how do i solve the linking problem to wxWidget? This is the CMakeCache file in the wxVTK directory --------------------------------------------------------------------- # This is the CMakeCache file. # For build in directory: /cygdrive/c/apps/wxVTK # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. # If you do want to change a value, simply edit, save, and exit the editor. # The syntax for the file is as follows: # KEY:TYPE=3DVALUE # KEY is the name of a variable in the cache. # TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!. # VALUE is the current value for the KEY. ######################## # EXTERNAL cache entries ######################## //Library is used for debug links only /cygdrive/c/apps/wxWidgets-2.6.3/build-static-debug_LINK_TYPE:STATIC=3Ddebu= g //Library is used for debug links only /cygdrive/c/apps/wxWidgets-2.6.3 /build-static-release/lib_LINK_TYPE:STATIC=3Doptimized //Library is used for debug links only /cygdrive/c/apps/wxWidgets-2.6.3 /build-static-release_LINK_TYPE:STATIC=3Doptimized //Library is used for both debug and optimized links /usr/local/lib_LINK_TYPE:STATIC=3Dgeneral //Path to a program. CMAKE_AR:FILEPATH=3D/usr/bin/ar //For backwards compatibility, what version of CMake commands and // syntax should this version of CMake allow. CMAKE_BACKWARDS_COMPATIBILITY:STRING=3D2.2 //Build type imported from VTK. CMAKE_BUILD_TYPE:STRING=3DCMAKE_CXX_FLAGS_RELEASE //C++ compiler CMAKE_CXX_COMPILER:STRING=3Dc++ //Flags used by the compiler during all build types. CMAKE_CXX_FLAGS:STRING=3D //Flags used by the compiler during debug builds. CMAKE_CXX_FLAGS_DEBUG:STRING=3D-g //Flags used by the compiler during release minsize builds. CMAKE_CXX_FLAGS_MINSIZEREL:STRING=3D-Os -DNDEBUG //Flags used by the compiler during release builds (/MD /Ob1 /Oi // /Ot /Oy /Gs will produce slightly less optimized but smaller // files). CMAKE_CXX_FLAGS_RELEASE:STRING=3D-O3 -DNDEBUG //Flags used by the compiler during Release with Debug Info builds. // CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=3D-O2 -g //C compiler CMAKE_C_COMPILER:STRING=3Dgcc //Flags for C compiler. CMAKE_C_FLAGS:STRING=3D //Flags used by the compiler during debug builds. CMAKE_C_FLAGS_DEBUG:STRING=3D-g //Flags used by the compiler during release minsize builds. CMAKE_C_FLAGS_MINSIZEREL:STRING=3D-Os -DNDEBUG //Flags used by the compiler during release builds (/MD /Ob1 /Oi // /Ot /Oy /Gs will produce slightly less optimized but smaller // files). CMAKE_C_FLAGS_RELEASE:STRING=3D-O3 -DNDEBUG //Flags used by the compiler during Release with Debug Info builds. // CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=3D-O2 -g //Flags used by the linker. CMAKE_EXE_LINKER_FLAGS:STRING=3D-L/usr/local/lib -lwx_msw_xrc-2.6 -lwx_msw_= qa- 2.6 -lwx_msw_html-2.6 -lwx_msw_adv-2.6 -lwx_msw_core-2.6 -lwx_base_xml-2.6-lwx_base_net- 2.6 -lwx_base-2.6 //Flags used by the linker during debug builds. CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=3D //Flags used by the linker during release minsize builds. CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=3D //Flags used by the linker during release builds. CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=3D //Flags used by the linker during Release with Debug Info builds. // CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=3D //Install path prefix, prepended onto install directories. CMAKE_INSTALL_PREFIX:PATH=3D/usr/local //Path to a program. CMAKE_MAKE_PROGRAM:FILEPATH=3D/usr/bin/make //Flags used by the linker during the creation of modules. CMAKE_MODULE_LINKER_FLAGS:STRING=3D //Flags used by the linker during debug builds. CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=3D //Flags used by the linker during release minsize builds. CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=3D //Flags used by the linker during release builds. CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=3D //Flags used by the linker during Release with Debug Info builds. // CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=3D //Path to a program. CMAKE_RANLIB:FILEPATH=3D/usr/bin/ranlib //Flags used by the linker during the creation of dll's. CMAKE_SHARED_LINKER_FLAGS:STRING=3D //Flags used by the linker during debug builds. CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=3D //Flags used by the linker during release minsize builds. CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=3D //Flags used by the linker during release builds. CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=3D //Flags used by the linker during Release with Debug Info builds. // CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=3D //If set, runtime paths are not added when using shared libraries. // CMAKE_SKIP_RPATH:BOOL=3DOFF //If true, cmake will use relative paths in makefiles and projects. // CMAKE_USE_RELATIVE_PATHS:BOOL=3DOFF //If this value is on, makefiles will be generated without the // .SILENT directive, and all commands will be echoed to the console // during the make. This is useful for debugging only. With Visual // Studio IDE projects all commands are done without /nologo. CMAKE_VERBOSE_MAKEFILE:BOOL=3DOFF //Single output directory for building all executables. EXECUTABLE_OUTPUT_PATH:PATH=3D/cygdrive/c/apps/wxVTK/bin //Single output directory for building all libraries. LIBRARY_OUTPUT_PATH:PATH=3D/cygdrive/c/apps/wxVTK/bin //The directory containing VTKConfig.cmake. This is either the // root of the build tree, or PREFIX/lib/vtk for an installation. // For VTK 4.0, this is the location of UseVTK.cmake. This is // either the root of the build tree or PREFIX/include/vtk for // an installation. VTK_DIR:PATH=3D/usr/local/lib/vtk //What is the path where the file wx/wx.h can be found WXWINDOWS_INCLUDE_DIR:PATH=3D/usr/local/include/wx-2.6 //What is the path where the file wx/setup.h can be found WXWINDOWS_INCLUDE_DIR_SETUPH:PATH=3D/usr/local/lib/wx/include/msw- ansi-debug-2.6 //What is the path where the file include/wx/wx.h can be found WXWINDOWS_ROOT_DIR:PATH=3D/usr/local/lib/wx //Set additional defines for wxWindows WXWINDOWS_SET_DEFINITIONS:BOOL=3DOFF //wxWindows shared debug build library WXWINDOWS_SHARED_DEBUG_LIBRARY:FILEPATH=3D/usr/local/lib //wxWindows shared release build library WXWINDOWS_SHARED_LIBRARY:FILEPATH=3D/usr/local/lib //wxWindows static debug build library WXWINDOWS_STATIC_DEBUG_LIBRARY:FILEPATH=3D/usr/local/lib //wxWindows static release build library WXWINDOWS_STATIC_LIBRARY:FILEPATH=3D/usr/local/lib //Use shared versions (dll) of wxWindows libraries? WXWINDOWS_USE_SHARED_LIBS:BOOL=3DON //Value Computed by CMake wxVTKSample_BINARY_DIR:STATIC=3D/cygdrive/c/apps/wxVTK //Value Computed by CMake wxVTKSample_SOURCE_DIR:STATIC=3D/cygdrive/c/apps/wxVTK ######################## # INTERNAL cache entries ######################## //Advanced flag for variable: CMAKE_AR CMAKE_AR-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_BUILD_TOOL CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=3D1 //What is the target build tool cmake is generating for. CMAKE_BUILD_TOOL:INTERNAL=3D/usr/bin/make //This is the directory where this CMakeCahe.txt was created CMAKE_CACHEFILE_DIR:INTERNAL=3D/cygdrive/c/apps/wxVTK //Major version of cmake used to create the current loaded cache // CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3D2 //Minor version of cmake used to create the current loaded cache // CMAKE_CACHE_MINOR_VERSION:INTERNAL=3D2 //Major version of cmake used to create the current loaded cache // CMAKE_CACHE_RELEASE_VERSION:INTERNAL=3Dpatch 3 //Path to CMake executable. CMAKE_COMMAND:INTERNAL=3D/usr/bin/cmake //Path to ctest program executable. CMAKE_CTEST_COMMAND:INTERNAL=3D/usr/bin/ctest //Advanced flag for variable: CMAKE_CXX_COMPILER CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=3D1 //full path to the compiler cmake found CMAKE_CXX_COMPILER_FULLPATH:INTERNAL=3D/usr/bin/c++ CMAKE_CXX_COMPILER_WORKS:INTERNAL=3D1 //Advanced flag for variable: CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_C_COMPILER CMAKE_C_COMPILER-ADVANCED:INTERNAL=3D1 //full path to the compiler cmake found CMAKE_C_COMPILER_FULLPATH:INTERNAL=3D/usr/bin/gcc CMAKE_C_COMPILER_WORKS:INTERNAL=3D1 //Advanced flag for variable: CMAKE_C_FLAGS CMAKE_C_FLAGS-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=3D1 //Path to cache edit program executable. CMAKE_EDIT_COMMAND:INTERNAL=3D/usr/bin/ccmake //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=3D1 //Modified flag for variable: CMAKE_EXE_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS-MODIFIED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL // CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO // CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=3D1 //Name of generator. CMAKE_GENERATOR:INTERNAL=3DUnix Makefiles //Start directory with the top level CMakeLists.txt file for this // project CMAKE_HOME_DIRECTORY:INTERNAL=3D/cygdrive/c/apps/wxVTK //Advanced flag for variable: CMAKE_MAKE_PROGRAM CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL // CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE // CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO // CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=3D1 //number of local generators CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=3D1 //Advanced flag for variable: CMAKE_RANLIB CMAKE_RANLIB-ADVANCED:INTERNAL=3D1 //Path to CMake installation. CMAKE_ROOT:INTERNAL=3D/usr/share/cmake-2.2.3 //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL // CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE // CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO // CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=3D1 //Result of TRY_RUN CMAKE_SIZEOF_VOID_P:INTERNAL=3D4 //Advanced flag for variable: CMAKE_SKIP_RPATH CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=3D1 //uname command CMAKE_UNAME:INTERNAL=3D/usr/bin/uname //Advanced flag for variable: CMAKE_USE_RELATIVE_PATHS CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: EXECUTABLE_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH-ADVANCED:INTERNAL=3D1 //Result of TRY_COMPILE HAVE_CMAKE_SIZEOF_VOID_P:INTERNAL=3DTRUE //Advanced flag for variable: LIBRARY_OUTPUT_PATH LIBRARY_OUTPUT_PATH-ADVANCED:INTERNAL=3D1 //Path to an executable Sample_CMAKE_PATH:INTERNAL=3D/cygdrive/c/apps/wxVTK //Path to an executable SplitSample_CMAKE_PATH:INTERNAL=3D/cygdrive/c/apps/wxVTK //Modified flag for variable: VTK_DIR VTK_DIR-MODIFIED:INTERNAL=3D1 //Advanced flag for variable: WXWINDOWS_INCLUDE_DIR WXWINDOWS_INCLUDE_DIR-ADVANCED:INTERNAL=3D1 //Modified flag for variable: WXWINDOWS_INCLUDE_DIR WXWINDOWS_INCLUDE_DIR-MODIFIED:INTERNAL=3D1 //Advanced flag for variable: WXWINDOWS_INCLUDE_DIR_SETUPH WXWINDOWS_INCLUDE_DIR_SETUPH-ADVANCED:INTERNAL=3D1 //Modified flag for variable: WXWINDOWS_INCLUDE_DIR_SETUPH WXWINDOWS_INCLUDE_DIR_SETUPH-MODIFIED:INTERNAL=3D1 //Advanced flag for variable: WXWINDOWS_ROOT_DIR WXWINDOWS_ROOT_DIR-ADVANCED:INTERNAL=3D1 //Modified flag for variable: WXWINDOWS_ROOT_DIR WXWINDOWS_ROOT_DIR-MODIFIED:INTERNAL=3D1 //Advanced flag for variable: WXWINDOWS_SET_DEFINITIONS WXWINDOWS_SET_DEFINITIONS-ADVANCED:INTERNAL=3D1 //Advanced flag for variable: WXWINDOWS_SHARED_DEBUG_LIBRARY WXWINDOWS_SHARED_DEBUG_LIBRARY-ADVANCED:INTERNAL=3D1 //Modified flag for variable: WXWINDOWS_SHARED_DEBUG_LIBRARY WXWINDOWS_SHARED_DEBUG_LIBRARY-MODIFIED:INTERNAL=3D1 //Advanced flag for variable: WXWINDOWS_SHARED_LIBRARY WXWINDOWS_SHARED_LIBRARY-ADVANCED:INTERNAL=3D1 //Modified flag for variable: WXWINDOWS_SHARED_LIBRARY WXWINDOWS_SHARED_LIBRARY-MODIFIED:INTERNAL=3D1 //Advanced flag for variable: WXWINDOWS_STATIC_DEBUG_LIBRARY WXWINDOWS_STATIC_DEBUG_LIBRARY-ADVANCED:INTERNAL=3D1 //Modified flag for variable: WXWINDOWS_STATIC_DEBUG_LIBRARY WXWINDOWS_STATIC_DEBUG_LIBRARY-MODIFIED:INTERNAL=3D1 //Advanced flag for variable: WXWINDOWS_STATIC_LIBRARY WXWINDOWS_STATIC_LIBRARY-ADVANCED:INTERNAL=3D1 //Modified flag for variable: WXWINDOWS_STATIC_LIBRARY WXWINDOWS_STATIC_LIBRARY-MODIFIED:INTERNAL=3D1 //Advanced flag for variable: WXWINDOWS_USE_SHARED_LIBS WXWINDOWS_USE_SHARED_LIBS-ADVANCED:INTERNAL=3D1 //Modified flag for variable: WXWINDOWS_USE_SHARED_LIBS WXWINDOWS_USE_SHARED_LIBS-MODIFIED:INTERNAL=3D1 //Path to an executable wxImagePlaneWidget_CMAKE_PATH:INTERNAL=3D/cygdrive/c/apps/wxVTK //Path to an executable wxImageViewer_CMAKE_PATH:INTERNAL=3D/cygdrive/c/apps/wxVTK //Path to an executable wxMedical3_CMAKE_PATH:INTERNAL=3D/cygdrive/c/apps/wxVTK ------------------------- |