[vtkusers] Undefined reference to Mesa

Hassan Amin hassan.amin at nu.edu.pk
Tue Apr 6 13:10:51 EDT 2010


The value of cmake variables for vtk5.0.3 are :

OPENGL_INCLUDE_DIR:PATH=/home/hassan/vision/Mesa-7.6.1/include

//Path to a library.
OPENGL_gl_LIBRARY:FILEPATH=/home/hassan/vision/Mesa-7.6.1/lib64/libGL.so

//Path to a library.
OPENGL_glu_LIBRARY:FILEPATH=

//Path to a file.
OPENGL_xmesa_INCLUDE_DIR:PATH=/home/hassan/vision/Mesa-7.6.1/include

//Path to a file.
OSMESA_INCLUDE_DIR:PATH=/home/hassan/vision/Mesa-7.6.1/include

//Path to a library.
OSMESA_LIBRARY:FILEPATH=/home/hassan/vision/Mesa-7.6.1/lib64/libOSMesa.so.7.6.1

VTK_USE_RPATH:BOOL=ON

The CMakeLIsts file for my program is :

PROJECT(Im2ModWarpLmkRandomInt)
cmake_minimum_required(VERSION 2.4)
if(COMMAND cmake_policy)
       cmake_policy(SET CMP0003 NEW)
     endif(COMMAND cmake_policy)

FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
 MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})

#Include VXLCore
INCLUDE_DIRECTORIES(
${VXLCORE_INCLUDE_DIR}
${VXLSRC}
)

FIND_PACKAGE(VXL)
  IF(VXL_FOUND)
    INCLUDE(${VXL_CMAKE_DIR}/UseVXL.cmake)
  ELSE(VXL_FOUND)
    MESSAGE("VXL_DIR should be set to the VXL build directory.")
ENDIF(VXL_FOUND)

SET(ITK_BIN ~/vision/paulirtk/irtk/build/ CACHE STRING " ITK LOCATION ")
INCLUDE(${ITK_BIN}/lib/IRTKInclude.cmake)

SET(MYINC ~/vision/ModelApproach2/source_wsc)
INCLUDE_DIRECTORIES(${MYINC})
LINK_DIRECTORIES(
  ${CMAKE_BIN_DIR}/src ${PROJECT_LIB_DIR}
${CMAKE_BIN_DIR}/src ${MYINC})

# remember to actually build and link with vtkFlRenderWindowInteractor.cxx
ADD_EXECUTABLE(Im2ModWarpLmkRandomInt main.cpp ${MYINC}/renderer.cpp
${MYINC}/AmeobaCameraOptLMK.cpp
 ${MYINC}/AmeobaCameraInitLMK.cpp ${MYINC}/AmeobaLtIntOpt.cpp
${MYINC}/AmeobaCamRotOptLMK.cpp
 ${MYINC}/GenerateTexture.cpp ${MYINC}/utility.cpp
${MYINC}/FileOps.cpp ${MYINC}/AmeobaWarpLmkInt.cpp ${MYINC}/MyPCA.cpp
 ${MYINC}/robustestimator.cpp )

TARGET_LINK_LIBRARIES(Im2ModWarpLmkRandomInt vtkCommon vtkIO
vtkImaging vtkGraphics vtkHybrid vtkRendering vil vul vul_io  vnl
vnl_algo vcl transformation++ registration++ geometry++ common++
image++ segmentation++ recipes )

Regards,






On Tue, Apr 6, 2010 at 4:48 PM, Kevin H. Hobbs <hobbsk at ohiou.edu> wrote:
> On 04/06/2010 07:10 AM, Hassan Amin wrote:
>> I am using cmake. I build Mesa7.6.1 myself, and vtk 5.0.2 myself as
>> well. I successfully built vtk with offscreen rendering using osmesa.
>> But when I build my application using osmesa I run into these linking
>> errors. My application uses a number of libraries including vtk, vxl,
>> and itk.
>>
>>
>
> Please use your e-mail program's "Reply All" function or add
> vtkusers at vtk.org to the list of recipients when you respond to e-mail
> from the list. That way the entire community can help.
>
> What are the values of the CMake variables :
>
> OPENGL_INCLUDE_DIR
> OPENGL_gl_LIBRARY
> OPENGL_glu_LIBRARY
> VTK_OPENGL_HAS_OSMESA
> OSMESA_INCLUDE_DIR
> OSMESA_LIBRARY
> VTK_USE_RPATH
>
> in your VTK CMakeCache.txt?
>
> Can you share the CMakeLists.txt file for your application?
>
> I link against VTK with OSMesa with a CMakeLists.txt file that looks like this :
>
>
> cmake_minimum_required(VERSION 2.4)
>
> PROJECT( series )
>
> FIND_PACKAGE(VTK REQUIRED)
> IF(NOT VTK_USE_RENDERING)
>  MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
> ENDIF(NOT VTK_USE_RENDERING)
> INCLUDE(${VTK_USE_FILE})
>
> ADD_EXECUTABLE( five_views_Npoly_1image five_views_Npoly_1image.cxx )
> TARGET_LINK_LIBRARIES( five_views_Npoly_1image vtkImaging vtkIO vtkCommon
>        vtkRendering vtkVolumeRendering vtkHybrid )
>
>
>
>
>



-- 
Dr. Hassan Amin
Assistant Professor
Head of Computer Science Department
National University(NUCES)
Peshawar Campus
Pakistan
Phone:0092-(0)91-111-128-128
Email: hassan.amin at nu.edu.pk



More information about the vtkusers mailing list