Re: [wxVTK] wxVTK: linking problems
Brought to you by:
malat
|
From: Andrea d. P. R. O. <asd...@gm...> - 2007-06-12 14:24:13
|
Hello Mathieu,
Thanks for your quick reply ;)
I'm using the CMakeLists.txt file that comes in wxVTK-1.2.tgz
Some lines related to the wxWidgets library are:
...
# The following allows you to access wxGLCanvas for GTK
IF(WIN32)
SET(GUI_EXECUTABLE WIN32)
ELSE(WIN32)
IF(APPLE)
SET(GUI_EXECUTABLE MACOSX_BUNDLE)
IF(VTK_USE_COCOA)
SET_SOURCE_FILES_PROPERTIES(
src/wxVTKRenderWindowInteractor.cxx
PROPERTIES COMPILE_FLAGS "-ObjC++")
ENDIF(VTK_USE_COCOA)
ELSE(APPLE)
# Ok X11 for sure, but just check:
IF(NOT VTK_USE_X)
MESSAGE(FATAL_ERROR "You need to have VTK_USE_X")
ENDIF(NOT VTK_USE_X)
#FIND_PACKAGE(GTK REQUIRED)
#INCLUDE_DIRECTORIES(${GTK_INCLUDE_DIR} )
# CMake 2.4.6:
FIND_PACKAGE(PkgConfig REQUIRED)
pkg_check_modules (GTK2 gtk+-2.0)
# For GTK we need a couple of stuff:
# gl: GLCanvas
# adv: wxSashLayoutWindow and such...
SET( wxWidgets_USE_LIBS gl adv )
ENDIF(APPLE)
ENDIF(WIN32)
# wxWidgets is required to build the project
FIND_PACKAGE(wxWidgets REQUIRED)
IF(wxWidgets_FOUND)
INCLUDE( ${wxWidgets_USE_FILE} )
#Add our own include path
INCLUDE_DIRECTORIES(
${wxVTKSample_SOURCE_DIR}/src
${GTK2_INCLUDE_DIRS}
)
... here some lines related to the projects, and:
LINK_LIBRARIES(
vtkRendering
${wxWidgets_LIBRARIES}
${GTK2_LIBRARIES}
)
IF( "${VTK_MAJOR_VERSION}" STREQUAL "5")
LINK_LIBRARIES( vtkWidgets )
ENDIF( "${VTK_MAJOR_VERSION}" STREQUAL "5")
... some ADD_EXECUTABLE sentences, and ends with:
ELSE(wxWidgets_FOUND)
MESSAGE("Cannot find wxWidgets libraries and/or header files")
ENDIF(wxWidgets_FOUND)
That's all. (I attach to this mail the whole CMakeLists.txt file)
I don't know if the sentence IF( "${VTK_MAJOR_VERSION}" STREQUAL "5")
could be the problem, because I'm not using VTK 5.0...
Thanks for your help,
Andrea Rueda
On 6/12/07, Mathieu Malaterre <mat...@gm...> wrote:
> Hi Andrea,
>
> On 6/12/07, Andrea del Pilar Rueda Olarte <asd...@gm...> wrote:
> > Hello,
> >
> > First, I apologize if my english is too bad ;)
>
> You do not need to be afraid, I only speak frenglish.
>
> > I'm trying to compile the wxVTK examples under Linux, but I'm getting
> > multiple errors at linking stage. My PC uses SuSE Linux 10.0, with VTK 4.2
> > and wxGTK 2.6.2. The wxGTK examples runs OK, also the VTK examples.
>
> Looks like you are not linking to the wxWidgets library. Could you
> post your CMakeLists.txt file, esp the line that start with
>
> TARGET_LINK_LIBRARIES( ...
>
> --
> Mathieu
>
|