[Insight-users] Problem at link time...
Luis Ibanez
luis.ibanez at kitware.com
Mon, 12 Jan 2004 16:39:21 -0500
Hi Jean-Philippe,
This is just a hunch...
but since you mention that you
have a lot of different paths...
We know that there is a limit to
the length of the string in VC++
that hold all the paths for linking.
We have seen cases in which users
install the software in directories
with very long names and henceforth
the cumulate lenght of the list of
paths exceed VisualStudio limit.
The surprising think is that when
this happens VS silently just truncates
the string and leaves out the remaining
paths.
I would suggest you to try installing
your packages in directories with much
shorter names and try again the build
process.
Regards
Luis
-----------------------
Jean-Philippe Guyon wrote:
> Hello,
>
> I still have problem compiling one of my project using Microsoft Visual
> C++ .Net 2003 on a windows 2000 workstation.
> I have used CMake 1.8.3 to generate the solution file for VC++ .Net.
> The problem is that only the last 6 paths specified in the list of
> "Additional Library Directories" of the VC++ solution are taken into
> consideration during the compilation of the project.
> Here is part of the command line used by VC++ to link my project.
>
> /OUT:"Release\Vetot.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:""
> /LIBPATH:"C:\piloo\Workspacez\ILS\Vetot-VC++\Plugins\ImageViewer\PngImageViewer\\"
> /LIBPATH:"C:\piloo\Workspacez\ILS\Vetot-VC++\Plugins\ImageViewer\ImageViewer2D\.\Release"
> /LIBPATH:"C:\piloo\Workspacez\ILS\Vetot-VC++\Plugins\ImageViewer\ImageViewer2D\\"
> /LIBPATH:"C:\piloo\Workspacez\ILS\Vetot-VC++\Plugins\ImageViewer\ImageViewer3D\.\Release"
> /LIBPATH:"C:\piloo\Workspacez\ILS\Vetot-VC++\Plugins\ImageViewer\ImageViewer3D\\"
> /PDB:"Release\Vetot.pdb" /SUBSYSTEM:CONSOLE /STACK:10000000 odbc32.lib
> odbccp32.lib ITKAlgorithms.lib ITKStatistics.lib ITKFEM.lib
> [... rest of the command line...]
>
> The actual list of "Additional Library Directories" contains something
> like 30 entries or more. As you can see above, only six appear in the
> command line.
> Has anyone experience this kind of problem ? Is there anyway I could
> possibly change CMake parameters, or VC++ .Net parameters so that all
> the library paths are included in the command line used for linking my
> project.
>
> I attached both the CMakeLists.txt file of my project, and a file
> containing the complete command line used for linking.
>
> Thanks,
>
> Jean-Philippe
>
>
>
>
> ------------------------------------------------------------------------
>
> PROJECT( Vetot )
>
> # Include CMake modules to locate the toolkits
> # necessary for VETOT...
>
> INCLUDE( ${CMAKE_ROOT}/Modules/FindITK.cmake )
> INCLUDE( ${CMAKE_ROOT}/Modules/FindFLTK.cmake )
> INCLUDE( ${CMAKE_ROOT}/Modules/FindOpenGL.cmake )
> INCLUDE( ${CMAKE_ROOT}/Modules/FindVTK.cmake )
>
> # Looking for the ITK package...
>
> FIND_PACKAGE(ITK)
> IF(ITK_FOUND)
> INCLUDE(${ITK_USE_FILE})
> ELSE(ITK_FOUND)
> MESSAGE(FATAL_ERROR "Vetot cannot be compiled without ITK. Please install ITK on your computer"
> " or specify its location manually.")
> ENDIF(ITK_FOUND)
>
> # Looking for the VTK package...
>
> FIND_PACKAGE(VTK)
> IF (VTK_FOUND)
> INCLUDE (${VTK_USE_FILE})
>
> # Test for VTK using std libs...
>
> IF(NOT VTK_USE_ANSI_STDLIB)
> MESSAGE("Warning. Your VTK was not built with the VTK_USE_ANSI_STDLIB "
> "option ON. Link errors may occur. Consider re-building VTK "
> "with this option ON. For MSVC 6, you MUST turn on the VTK "
> "option. ITK will not link otherwise.")
> ENDIF(NOT VTK_USE_ANSI_STDLIB)
>
> # Test for VTK building Hybrid...
>
> IF(NOT VTK_USE_HYBRID)
> MESSAGE("Your VTK was not built with the VTK_USE_HYBRID option ON. "
> "Please reconfigure and recompile VTK with this option before "
> "trying to use it with ITK.")
> SET(VTK_FOUND 0)
> ENDIF(NOT VTK_USE_HYBRID)
> ELSE(VTK_FOUND)
> MESSAGE(FATAL_ERROR "Vetot cannot be compiled without VTK. Please install VTK on your computer"
> " or specify its location manually.")
> ENDIF (VTK_FOUND)
>
> # Looking for the itkUNC package...
>
> INCLUDE( ${Vetot_SOURCE_DIR}/FindITKUNC.cmake )
>
> IF(USE_ITKUNC_FILE)
>
> INCLUDE(${USE_ITKUNC_FILE})
>
> IF(itkUNC_SOURCE_DIR)
>
> # Looking for the InsightApplications package...
> INCLUDE( ${itkUNC_SOURCE_DIR}/FindInsightApplications.cmake )
>
> IF(InsightApplications_SOURCE_DIR)
>
> INCLUDE( ${InsightApplications_SOURCE_DIR}/FindFltkImageViewer.cmake )
>
> # Include subdirectories...
> SUBDIRS( Plugins )
>
> # Definition of directories where include files can
> # be found...
> INCLUDE_DIRECTORIES(
> ${FLTK_INCLUDE_PATH}
> ${OPENGL_INCLUDE_PATH}
>
> ${Vetot_SOURCE_DIR}
> ${Vetot_SOURCE_DIR}/Common
> ${Vetot_SOURCE_DIR}/Filters
> ${Vetot_SOURCE_DIR}/IO
> ${Vetot_SOURCE_DIR}/Helpers
> ${Vetot_SOURCE_DIR}/Plugins
> ${Vetot_SOURCE_DIR}/Plugins/ProgressWindow
> ${Vetot_SOURCE_DIR}/Plugins/HandTracer
> ${Vetot_SOURCE_DIR}/Plugins/HistogramViewer
> ${Vetot_SOURCE_DIR}/Plugins/ImageViewer
> ${Vetot_SOURCE_DIR}/Plugins/ImageViewer/PngImageViewer
> ${Vetot_SOURCE_DIR}/Plugins/ImageViewer/ImageViewer2D
> ${Vetot_SOURCE_DIR}/Plugins/ImageViewer/ImageViewer3D
> ${Vetot_SOURCE_DIR}/Plugins/SlicerOptionWindow
>
> ${Vetot_BINARY_DIR}
> ${Vetot_BINARY_DIR}/Common
> ${Vetot_BINARY_DIR}/Plugins
> ${Vetot_BINARY_DIR}/Plugins/ImageViewer
> ${Vetot_BINARY_DIR}/Plugins/ImageViewer/PngImageViewer
> ${Vetot_BINARY_DIR}/Plugins/ImageViewer/ImageViewer2D
> ${Vetot_BINARY_DIR}/Plugins/ImageViewer/ImageViewer3D
> ${Vetot_BINARY_DIR}/Plugins/SlicerOptionWindow
> ${Vetot_BINARY_DIR}/Plugins/ProgressWindow
> ${Vetot_BINARY_DIR}/Plugins/HandTracer
>
> ${InsightApplications_SOURCE_DIR}/LandmarkInitializedMutualInformationRegistration
>
> ${FltkImageViewer_INCLUDE_DIR}
> ${FltkImageViewer_BINARY_DIR}
>
> ${itkUNC_SOURCE_DIR}/Code/Filters
> ${itkUNC_SOURCE_DIR}/Code/ObjectViewer/Renderer
> ${itkUNC_SOURCE_DIR}/Code/ObjectViewer/RenderMethod
> ${itkUNC_SOURCE_DIR}/Code/ObjectViewer/RenderMethod/OpenGL/Slicer
> ${itkUNC_SOURCE_DIR}/Code/ObjectViewer/RenderMethod/OpenGL/2D
> ${itkUNC_SOURCE_DIR}/Code/ObjectViewer/RenderMethod/OpenGL/3D
> ${itkUNC_SOURCE_DIR}/Code/ObjectViewer/RenderMethod/VTK/3D/VTK4
> ${itkUNC_SOURCE_DIR}/Code/ObjectViewer/Display
> ${itkUNC_SOURCE_DIR}/Code/ObjectViewer/Display/Fltk
> )
>
> SET( FileToCopy_SRCS
> resources/SplashScreen.gif
> Plugins/Fl_ColoredButton.h
> Plugins/ImageViewer/PngImageViewer/PngImageSliceViewer.h
> Plugins/ImageViewer/ImageViewer2D/ImageViewer2D.h
> Plugins/ImageViewer/ImageViewer3D/ImageViewer3D.h
> Help/LoadStudyHelp.html
> Help/SegmentationHelp.html
> Help/RegistrationHelp.html
> Help/VisualizationHelp.html
> Help/SaveStudyHelp.html
> Help/PreferencesHelp.html
> Help/SegmentationPreferencesHelp.html
> Help/RegistrationPreferencesHelp.html
> )
>
> # Copy necessary files to the destination directory...
>
> FOREACH(FileToCopy ${FileToCopy_SRCS})
> CONFIGURE_FILE(
> ${Vetot_SOURCE_DIR}/${FileToCopy}
> ${Vetot_BINARY_DIR}/${FileToCopy} COPYONLY)
> ENDFOREACH(FileToCopy)
>
> # Define the list of source files...
>
> SET( Vetot_SRCS
> Common/itkTumorSpatialObject.h
> Common/itkTumorSpatialObject.txx
> Common/Vetot.cxx
> Common/VetotCallback.h
> Common/VetotCommand.h
> Common/VetotCommand.cxx
> Common/VetotCore.h
> Common/VetotCore.cxx
> Common/VetotDisplay.h
> Common/VetotDisplay.cxx
> Common/VetotDisplayCallback.h
> Common/VetotDisplayUtilities.h
> Common/VetotDisplayUtilities.cxx
> Common/VetotEvent.h
> Common/VetotGUI.h
> Common/VetotGUI.cxx
> Common/VetotGUICallback.h
> Common/VetotLandmarkEvent.h
> Common/VetotMacro.h
> Common/VetotParameters.h
> Common/VetotRegistration.h
> Common/VetotRegistration.cxx
> Common/VetotSegmentation.h
> Common/VetotSegmentation.cxx
> Common/VetotSegmentationCallback.h
> Common/VetotSegmentEvent.h
> Common/VetotHandSegmentation.h
> Common/VetotHandSegmentation.cxx
>
> Filters/Cropper.h
> Filters/Cropper.txx
> Filters/Padder.h
> Filters/Padder.txx
> Filters/Smoothener.h
> Filters/Smoothener.txx
> Filters/itkInverseIntensityImageFilter.h
> Filters/itkInverseIntensityImageFilter.txx
>
> Helpers/CoordSystGenerator.h
> Helpers/CoordSystGenerator.txx
> Helpers/Measurer.h
> Helpers/Measurer.txx
> Helpers/PreProcessor.h
> Helpers/PreProcessor.txx
> Helpers/Registrator.h
> Helpers/Registrator.txx
> Helpers/Resampler.h
> Helpers/Resampler.txx
> Helpers/Segmenter.h
> Helpers/Segmenter.txx
> Helpers/SegmenterProgressCommand.h
> Helpers/SegmenterProgressCommand.cxx
>
> IO/VetotIO.h
> IO/VetotIO.cxx
> IO/VetotIOModule.h
> IO/VetotIOModule.cxx
> IO/VetotIOEvent.h
> IO/VetotMetaIO.h
> IO/VetotMetaIO.cxx
> IO/VetotStudyIO.h
> IO/VetotStudyIO.cxx
> IO/VetotExportIO.h
> IO/VetotExportIO.cxx
> IO/VetotPreferencesIO.h
> IO/VetotPreferencesIO.cxx
>
> Plugins/Fl_SplashScreen.h
> Plugins/Fl_SplashScreen.cxx
> Plugins/Fl_ColoredButton.h
> Plugins/Fl_ColoredButton.cxx
>
> ${InsightApplications_SOURCE_DIR}/LandmarkInitializedMutualInformationRegistration/LandmarkRegistrator.h
> ${InsightApplications_SOURCE_DIR}/LandmarkInitializedMutualInformationRegistration/LandmarkRegistrator.cxx
> )
>
> SET( Vetot_LIBRARIES
> # ITK libraries...
> ${ITK_LIBRARIES}
>
> # FLTK libraries...
> ${FLTK_LIBRARY}
>
> # OpenGl libraries...
> ${OPENGL_LIBRARY}
>
> # ITK Applications libraries...
> ${FltkImageViewer_LIBRARY}
>
> # VTK libraries...
> #${VTK_LIBRARY_DIRS}/release/vtkRendering
> #${VTK_LIBRARY_DIRS}/release/vtkHybrid
>
> # Vetot internal libraries...
> HandTracer
> ProgressWindow
> SlicerOptionWindow
> HistogramViewer
> PngImageViewer
> ImageViewer2D
> ImageViewer3D
>
> # ITK UNC libraries...
> #${itkUNC_BINARY_DIR}/bin/release/ObjectViewer
> #${itkUNC_BINARY_DIR}/bin/release/RenderMethod
> #${itkUNC_BINARY_DIR}/bin/release/solVTKRenderMethod
> #${itkUNC_BINARY_DIR}/bin/release/solOpenGLRenderMethod
>
> # ITK Applications libraries...
> LandmarkInitializedMutualInformationRegistration
> )
>
> # Definition of path to the directories containing
> # the library necessary for VETOT...
>
> LINK_DIRECTORIES(
>
> # Insight Applications libraries path...
> ${InsightApplications_BINARY_DIR}/LandmarkInitializedMutualInformationRegistration
> ${InsightApplications_BINARY_DIR}/Auxiliary/FltkImageViewer
>
> # ITK UNC libraries path...
> ${itkUNC_BINARY_DIR}
> ${itkUNC_BINARY_PATH}
>
> # VTK libraries path...
> #${VTK_LIBRARY_DIRS}
>
> # Vetot internal libraries path...
> ${Vetot_BINARY_DIR}/Plugins/ProgressWindow
> ${Vetot_BINARY_DIR}/Plugins/HandTracer
> ${Vetot_BINARY_DIR}/Plugins/HistogramViewer
> ${Vetot_BINARY_DIR}/Plugins/SlicerOptionWindow
> ${Vetot_BINARY_DIR}/Plugins/ImageViewer/PngImageViewer
> ${Vetot_BINARY_DIR}/Plugins/ImageViewer/ImageViewer2D
> ${Vetot_BINARY_DIR}/Plugins/ImageViewer/ImageViewer3D
> )
>
> # Define the executable...
>
> ADD_EXECUTABLE( Vetot Vetot_SRCS )
> TARGET_LINK_LIBRARIES( Vetot ${Vetot_LIBRARIES} )
> FLTK_WRAP_UI( Vetot Common/VetotGUIBase.fl )
>
> ELSE(InsightApplications_SOURCE_DIR)
> MESSAGE("VETOT cannot be built without InsightApplications. "
> "Please make sure you specify the path to the InsightApplications directory "
> "and run CMake again. If you have not downloaded InsightApplications, please"
> " refer to http://www.itk.org.")
> ENDIF(InsightApplications_SOURCE_DIR)
> ENDIF(itkUNC_SOURCE_DIR)
> ELSE(USE_ITKUNC_FILE)
> MESSAGE("VETOT cannot be built without itkUNC. "
> "Please make sure you specify the path to the your itkUNC directory "
> "and run CMake again. If you have not downloaded itkUNC yet, please refer"
> " to http://www.caddlab.rad.unc.edu.")
> ENDIF(USE_ITKUNC_FILE)
>
>
> ------------------------------------------------------------------------
>
> /OUT:"Release\Vetot.exe"
> /INCREMENTAL:NO
> /NOLOGO
> /LIBPATH:""
> /LIBPATH:"C:\piloo\Workspacez\ILS\Vetot-VC++\Plugins\ImageViewer\PngImageViewer\\"
> /LIBPATH:"C:\piloo\Workspacez\ILS\Vetot-VC++\Plugins\ImageViewer\ImageViewer2D\.\Release"
> /LIBPATH:"C:\piloo\Workspacez\ILS\Vetot-VC++\Plugins\ImageViewer\ImageViewer2D\\"
> /LIBPATH:"C:\piloo\Workspacez\ILS\Vetot-VC++\Plugins\ImageViewer\ImageViewer3D\.\Release"
> /LIBPATH:"C:\piloo\Workspacez\ILS\Vetot-VC++\Plugins\ImageViewer\ImageViewer3D\\"
> /PDB:"Release\Vetot.pdb"
> /SUBSYSTEM:CONSOLE
> /STACK:10000000 odbc32.lib odbccp32.lib
> ITKAlgorithms.lib
> ITKStatistics.lib
> ITKFEM.lib
> C:\piloo\Workspacez\fltk-1.1.4rc2\lib\fltk.lib
> C:\piloo\Workspacez\fltk-1.1.4rc2\lib\fltkgl.lib
> C:\piloo\Workspacez\fltk-1.1.4rc2\lib\fltkforms.lib
> C:\piloo\Workspacez\fltk-1.1.4rc2\lib\fltkimages.lib
> wsock32.lib
> comctl32.lib
> glu32.lib
> opengl32.lib
> C:\piloo\Workspacez\InsightApplications-VC++\Auxiliary\FltkImageViewer\Release\ITKFltkImageViewer.lib
> HandTracer.lib
> ProgressWindow.lib
> SlicerOptionWindow.lib
> HistogramViewer.lib
> PngImageViewer.lib
> ImageViewer2D.lib
> ImageViewer3D.lib
> LandmarkInitializedMutualInformationRegistration.lib
> ITKNumerics.lib
> ITKBasicFilters.lib
> ITKIO.lib
> ITKCommon.lib
> itkvnl_inst.lib
> itkvnl_algo.lib
> itkvnl.lib
> itkvcl.lib
> itknetlib.lib
> itksys.lib
> itkpng.lib
> itktiff.lib
> itkzlib.lib
> itkjpeg.lib
> ITKMetaIO.lib
> ITKDICOMParser.lib
> ITKEXPAT.lib
> kernel32.lib
> user32.lib
> gdi32.lib
> winspool.lib
> comdlg32.lib
> advapi32.lib
> shell32.lib
> ole32.lib
> oleaut32.lib
> uuid.lib
> odbc32.lib
> odbccp32.lib
> "\piloo\Workspacez\Insight-VC++\bin\release\ITKAlgorithms.lib"
> "\piloo\Workspacez\Insight-VC++\bin\release\ITKStatistics.lib"
> "\piloo\Workspacez\Insight-VC++\bin\release\ITKFEM.lib"
> "\piloo\Workspacez\fltk-1.1.4rc2\lib\fltk.lib"
> "\piloo\Workspacez\fltk-1.1.4rc2\lib\fltkgl.lib"
> "\piloo\Workspacez\fltk-1.1.4rc2\lib\fltkforms.lib"
> "\piloo\Workspacez\fltk-1.1.4rc2\lib\fltkimages.lib"
> "\piloo\Workspacez\InsightApplications-VC++\Auxiliary\FltkImageViewer\Release\ITKFltkImageViewer.lib"