[CMake] Problems using Boost and VS 8 Express
Gheorghe Postelnicu
gheorghe.postelnicu at gmail.com
Thu Aug 30 11:33:10 EDT 2007
Hi,
I am trying to use CMake for a project I had configured on Linux until
now and I get link errors with Boost, namely here is my CMakeLists.txt
file:
1. The project built with CMake has C:\Boost\lib in the path
2. in C:\Boost\lib I do have the program_options library, called
boost_program_options-vc80-1_34_1.lib
3. I don't understand what the problem could be.
Sorry to burden you with this silly question. I would appreciate a
hint towards a solution.
Cheers,
FIND_PACKAGE(ITK REQUIRED)
IF( NOT ITK_FOUND )
MESSAGE(FATAL_ERROR
"ITK not found!!!")
ENDIF(NOT ITK_FOUND)
INCLUDE( ${ITK_USE_FILE} )
FIND_PACKAGE(Boost REQUIRED)
IF( NOT Boost_FOUND )
MESSAGE(FATAL_ERROR
"Boost not found!!!")
ENDIF(NOT Boost_FOUND)
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} )
LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
SET(Libraries
ITKIO
ITKCommon
boost_program_options
)
ADD_EXECUTABLE(itkReg2dMi registerNissl2Nissl.cpp
cmd_line_parser.cpp)
TARGET_LINK_LIBRARIES(itkReg2dMi ${Libraries} )
ADD_EXECUTABLE(itkReg3d reg3d.cpp
cmd_line_parser.cpp)
TARGET_LINK_LIBRARIES(itkReg3d ${Libraries} )
ADD_EXECUTABLE(itkReg3dV reg3dV.cpp
cmd_line_parser.cpp
itkVersorRigid3DGradientDescentOptimizer.cpp)
TARGET_LINK_LIBRARIES(itkReg3dV ${Libraries} )
ADD_EXECUTABLE(join3d make3dVol.cpp)
TARGET_LINK_LIBRARIES(join3d ${Libraries} )
ADD_EXECUTABLE(itkVolumeReconstruction itkVolumeReconstruction.cpp
volume_reconstruction.cpp
slice_series.cpp
itkVersorRigid3DGradientDescentOptimizer.cpp)
TARGET_LINK_LIBRARIES(itkVolumeReconstruction ${Libraries} )
-------------
and here is the error I get for one of the targets:
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
1>Checking Build System
1>-- Configuring done
1>-- Generating done
1>-- Build files have been written to: C:/mgh/histo-volRecon/build
1>Build log was saved at
"file://c:\mgh\histo-volRecon\build\ZERO_CHECK.dir\Release\BuildLog.htm"
1>ZERO_CHECK - 0 error(s), 0 warning(s)
2>------ Build started: Project: join3d, Configuration: Release Win32 ------
2>Compiling...
2>make3dVol.cpp
2>Linking...
2>LINK : fatal error LNK1181: cannot open input file 'boost_program_options.lib'
2>Build log was saved at
"file://c:\mgh\histo-volRecon\build\join3d.dir\Release\BuildLog.htm"
2>join3d - 1 error(s), 0 warning(s)
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
--
Gheorghe Postelnicu, PhD
MGH, Harvard Medical School
More information about the CMake
mailing list