Tool/software: TI C/C++ Compiler
Hello,
I am trying to cross-compile a simple project using CMake. I have a set up a very simple project with one library and one executable. I want to compile the library and then link it in the executable.
Currently I'm having the problem that the library I'm creating doesn't export any symbols.
To test if what I am doing is correct, I first created a static library project and a executable project in CCS. All worked fine. In order for me to test the CMake generated library, I'm trying to link the CMake generated library with the executable from CCS, and I'm getting the error:
warning #10189-D: archive symbol directory is missing from archive "libprintTest.a" undefined first referenced symbol in file --------- ---------------- PrintTest::PrintTest() ./main.obj PrintTest::~PrintTest() ./main.obj PrintTest::doIt() ./main.obj error #10234-D: unresolved symbols remain error #10010: errors encountered during linking; "test.out" not built
Any ideas?
I have attached my CMake test project. To run it, you just have to have CMake installed (https://cmake.org
cd <proj_dir>/build cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .. make
The current compile output is:
-- CGT_TOOLCHAIN_DIR not explicitly set, using /Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS -- The C compiler identification is TI 20.2.0 -- The CXX compiler identification is TI 20.2.0 -- Check for working C compiler: /Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/bin/cl2000 -- Check for working C compiler: /Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/bin/cl2000 - works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/bin/cl2000 -- Check for working CXX compiler: /Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/bin/cl2000 - works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Treat warning as errors is enabled -- Configuring done -- Generating done -- Build files have been written to: /Users/Rafa/Documents/workspace/cmakeTest/build build Rafa$ make /Applications/CMake.app/Contents/bin/cmake -S/Users/Rafa/Documents/workspace/cmakeTest -B/Users/Rafa/Documents/workspace/cmakeTest/build --check-build-system CMakeFiles/Makefile.cmake 0 /Applications/CMake.app/Contents/bin/cmake -E cmake_progress_start /Users/Rafa/Documents/workspace/cmakeTest/build/CMakeFiles /Users/Rafa/Documents/workspace/cmakeTest/build/CMakeFiles/progress.marks /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 all /Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/CMakeFiles/printTest.dir/build.make src/CMakeFiles/printTest.dir/depend cd /Users/Rafa/Documents/workspace/cmakeTest/build && /Applications/CMake.app/Contents/bin/cmake -E cmake_depends "Unix Makefiles" /Users/Rafa/Documents/workspace/cmakeTest /Users/Rafa/Documents/workspace/cmakeTest/src /Users/Rafa/Documents/workspace/cmakeTest/build /Users/Rafa/Documents/workspace/cmakeTest/build/src /Users/Rafa/Documents/workspace/cmakeTest/build/src/CMakeFiles/printTest.dir/DependInfo.cmake --color= Scanning dependencies of target printTest /Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/CMakeFiles/printTest.dir/build.make src/CMakeFiles/printTest.dir/build [ 25%] Building CXX object src/CMakeFiles/printTest.dir/printtest.cpp.obj cd /Users/Rafa/Documents/workspace/cmakeTest/build/src && /Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/bin/cl2000 --compile_only --cpp_file=/Users/Rafa/Documents/workspace/cmakeTest/src/printtest.cpp --include_path=/Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/include --include_path=/Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/include/stlport --include_path=/Users/Rafa/Documents/workspace/cmakeTest/src -v28 -ml -mt --float_support=fpu32 -Ooff --advice:performance=all --diag_warning=225 --diag_wrap=off --display_error_number --abi=coffabi --c++03 -pdew --output_file=CMakeFiles/printTest.dir/printtest.cpp.obj [ 50%] Linking CXX static library libprintTest.a cd /Users/Rafa/Documents/workspace/cmakeTest/build/src && /Applications/CMake.app/Contents/bin/cmake -P CMakeFiles/printTest.dir/cmake_clean_target.cmake cd /Users/Rafa/Documents/workspace/cmakeTest/build/src && /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/printTest.dir/link.txt --verbose=1 /Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/bin/ar2000 -r libprintTest.a CMakeFiles/printTest.dir/printtest.cpp.obj ==> new archive 'libprintTest.a' ==> building archive 'libprintTest.a' /usr/bin/ranlib libprintTest.a warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: warning for library: libprintTest.a the table of contents is empty (no object file members in the library define global symbols) [ 50%] Built target printTest /Applications/Xcode.app/Contents/Developer/usr/bin/make -f example/CMakeFiles/printTestExample.dir/build.make example/CMakeFiles/printTestExample.dir/depend cd /Users/Rafa/Documents/workspace/cmakeTest/build && /Applications/CMake.app/Contents/bin/cmake -E cmake_depends "Unix Makefiles" /Users/Rafa/Documents/workspace/cmakeTest /Users/Rafa/Documents/workspace/cmakeTest/example /Users/Rafa/Documents/workspace/cmakeTest/build /Users/Rafa/Documents/workspace/cmakeTest/build/example /Users/Rafa/Documents/workspace/cmakeTest/build/example/CMakeFiles/printTestExample.dir/DependInfo.cmake --color= Scanning dependencies of target printTestExample /Applications/Xcode.app/Contents/Developer/usr/bin/make -f example/CMakeFiles/printTestExample.dir/build.make example/CMakeFiles/printTestExample.dir/build [ 75%] Building CXX object example/CMakeFiles/printTestExample.dir/main.cpp.obj cd /Users/Rafa/Documents/workspace/cmakeTest/build/example && /Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/bin/cl2000 --compile_only --cpp_file=/Users/Rafa/Documents/workspace/cmakeTest/example/main.cpp --include_path=/Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/include --include_path=/Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/include/stlport --include_path=/Users/Rafa/Documents/workspace/cmakeTest/src -v28 -ml -mt --float_support=fpu32 -Ooff --advice:performance=all --diag_warning=225 --diag_wrap=off --display_error_number --abi=coffabi --c++03 -pdew --output_file=CMakeFiles/printTestExample.dir/main.cpp.obj [100%] Linking CXX executable printTestExample cd /Users/Rafa/Documents/workspace/cmakeTest/build/example && /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/printTestExample.dir/link.txt --verbose=1 /Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/bin/cl2000 --run_linker --output_file=printTestExample --map_file=printTestExample.map --search_path=/Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/lib --search_path=/Applications/ti/c2000/C2000Ware_3_01_00_00/device_support/f2833x/headers/cmd --search_path=/Applications/ti/c2000/C2000Ware_3_01_00_00/device_support/f2833x/common/cmd --library=F28335.cmd --library=DSP2833x_Headers_nonBIOS.cmd -llibc.a --library=printtest --heap_size=0x100 --stack_size=0x300 --warn_sections --reread_libs --diag_wrap=off --display_error_number --rom_model CMakeFiles/printTestExample.dir/main.cpp.obj <Linking> error: cannot find file "printtest" warning #10211-D: cannot resolve archive /Applications/ti/ccs930/ccs/tools/compiler/ti-cgt-c2000_20.2.0.LTS/lib/libc.a to a compatible library, as no input files have been encountered warning #10062-D: entry-point symbol "_c_int00" undefined error #10010: errors encountered during linking; "printTestExample" not built >> Compilation failure make[2]: *** [example/printTestExample] Error 1 make[1]: *** [example/CMakeFiles/printTestExample.dir/all] Error 2 make: *** [all] Error 2