Portál AbcLinuxu, 12. května 2025 03:24
set(CMAKE_C_COMPILER gcc -m32) set(CMAKE_CXX_COMPILER g++ -m32) set(CMAKE_FIND_ROOT_PATH /emul/ia32-linux)
Bohužel to nestačí. Nemůže najít libstdc++ pro 32 bitů resp. nachází jen 64bitovou.<BR>
Ta 32bitová je přitom v /emul/ia32-linux/usr/lib ...
ještě vadilo (ale 64bitový build se udělal) chybějící:<BR>
SET(CMAKE_SYSTEM_NAME Linux)
<BR><BR>
<PRE>
kamil@kamilX2:~/auxproj/sdl/speed_test/build32$ cmake -DCMAKE_TOOLCHAIN_FILE=~/ia32.cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- broken
CMake Error at /usr/share/cmake-2.6/Modules/CMakeTestCXXCompiler.cmake:25 (MESSAGE):
The C++ compiler "/usr/bin/g++" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: /home/kamil/auxproj/sdl/speed_test/build32/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
make[1]: Entering directory
`/home/kamil/auxproj/sdl/speed_test/build32/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report
/home/kamil/auxproj/sdl/speed_test/build32/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.o
/usr/bin/g++ -m32 -o CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.o
-c
/home/kamil/auxproj/sdl/speed_test/build32/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTryCompileExec
/usr/bin/cmake -E cmake_link_script
CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1
/usr/bin/g++ -m32 CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.o -o
cmTryCompileExec -rdynamic
/usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.so when searching for
-lstdc++
/usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.so when searching for
-lstdc++
/usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make[1]: Leaving directory
`/home/kamil/auxproj/sdl/speed_test/build32/CMakeFiles/CMakeTmp'
make[1]: *** [cmTryCompileExec] Error 1
make: *** [cmTryCompileExec/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
-- Configuring done
</PRE>
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.