From: Wheeler, F. W (Research) <wh...@cr...> - 2003-03-04 00:05:50
|
I'm trying to get VXL to compile under ICC (Intel C++ compiler). CMake knows how to use this compiler, so a vanilla static build goes pretty smoothly, until it comes time to link with vcsl.a. I'm getting the following undefined symbol error. Building executable vcsl_example1... /home/wheeler/work_vxl/vxl_bld_icc/lib/libvcsl.a(vcsl_cartesian_3d.o): In function `vcsl_cartesian_3d': /home/wheeler/work_vxl/vxl_src/core/vcsl/vcsl_cartesian_3d.cxx:16: undefined reference to `vcsl_spatial::path_from_local_to_cs(vbl_smart_ptr<vcsl_spatial> const&, double, std::vector<vbl_smart_ptr<vcsl_spatial_transformation>, std::allocator<vbl_smart_ptr<vcsl_spatial_transformation> > >&, std::vector<bool, std::allocator<bool> >&)' /home/wheeler/work_vxl/vxl_src/core/vcsl/vcsl_cartesian_3d.cxx:16: undefined reference to `vcsl_spatial::recursive_path_from_local_to_cs(vbl_smart_ptr<vcsl_spatial> const&, double, std::vector<vbl_smart_ptr<vcsl_spatial_transformation>, std::allocator<vbl_smart_ptr<vcsl_spatial_transformation> > >&, std::vector<bool, std::allocator<bool> >&)' If anybody familiar with vcsl knows about anything funny with this class/method that might be an issue here, please let me know. Also, general tips on debugging missing symbols would be appreciated. I can't figure out why this symbol is reported missing. nm tells me that this exact symbol is defined in vcsl_spatial.o, and is defined in vcsl.a. vcsl.a also lists the symbol as undefined, I guess because it is needed by other code that is in that library. example1.o does not directly use this symbol, so if it is required, that requirement must be because it is (both defined and) undefined in vcsl.a. I've been VERY careful to make sure it is in fact the exact same symbol name that is defined in vcsl_spatial.o and in vcsl.a and also undefined in vcsl.a. The demangled names are precisely the same. The non-demangled names have slight differences at the end, but this difference is consistent with other stuff in the library, for which an error is not reported. Here is the slight difference in symbol names without demangling. % nm -g ~/work_vxl/vxl_bld_icc/lib/libvcsl.a | grep 'path_from_local_to_cs' | grep -v path_from_local_to_cs_exists|grep -v recursive_path_from_local_to_cs 00001650 T _ZN12vcsl_spatial21path_from_local_to_csERK13vbl_smart_ptrIS_EdRSt6vectorIS0_I27vcsl_spatial_transfor mationESaIS6_EERSt6vectorIbSaIbEE U _ZN12vcsl_spatial21path_from_local_to_csERK13vbl_smart_ptrIS_EdRSt6vectorIS0_I27vcsl_spatial_transfor mationESaIS6_EERS4_IbSaIbEE ... Here are the identical symbol names with demangling. % nm -gC ~/work_vxl/vxl_bld_icc/lib/libvcsl.a | grep 'path_from_local_to_cs' | grep -v path_from_local_to_cs_exists|grep -v recursive_path_from_local_to_cs 00001650 T vcsl_spatial::path_from_local_to_cs(vbl_smart_ptr<vcsl_spatial> const&, double, std::vector<vbl_smart_ptr<vcsl_spatial_transformation>, std::allocator<vbl_smart_ptr<vcsl_spatial_transformation> > >&, std::vector<bool, std::allocator<bool> >&) U vcsl_spatial::path_from_local_to_cs(vbl_smart_ptr<vcsl_spatial> const&, double, std::vector<vbl_smart_ptr<vcsl_spatial_transformation>, std::allocator<vbl_smart_ptr<vcsl_spatial_transformation> > >&, std::vector<bool, std::allocator<bool> >&) ... For completeness, here is how I prepopulate the CMake cache. CMAKE_C_COMPILER:FILEPATH=icc CMAKE_CXX_COMPILER:FILEPATH=icc CMAKE_C_FLAGS:STRING=-w -O0 -g CMAKE_CXX_FLAGS:STRING=-w -O0 -g BUILD_SHARED_LIBS:BOOL=OFF BUILD_VGUI:BOOL=ON VXL_FORCE_V3P_ZLIB:BOOL=YES VXL_FORCE_V3P_PNG:BOOL=YES VXL_FORCE_V3P_JPEG:BOOL=YES VXL_FORCE_V3P_MPEG2:BOOL=YES VXL_FORCE_V3P_TIFF:BOOL=YES Here is some version info on the icc compiler. It mostly mimics gcc command-line options. % icc -V Intel(R) C++ Compiler for 32-bit applications, Version 7.0 Build 20021021Z Copyright (C) 1985-2002 Intel Corporation. All rights reserved. GNU ld version 2.10.91 (with BFD 2.10.91.0.2) Supported emulations: elf_i386 i386linux elf_i386_glibc21 Baffled ... Fred Wheeler |