Hi, I recently downloaded px4 repository and tried to build PX4 Firmware on raspi3.
native build for PX4 Firmware(make posix_rpi_native )
error as follow:
CMake Error at /usr/local/share/cmake-3.2/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler “/usr/bin/c++” is not able to compile a simple test
program.
It fails with the following output:
Change Dir: /home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" “cmTryCompileExec583486650/fast”
make[1]: Entering directory
‘/home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp’
/usr/bin/make -f CMakeFiles/cmTryCompileExec583486650.dir/build.make
CMakeFiles/cmTryCompileExec583486650.dir/build
make[2]: Entering directory
‘/home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp’
/usr/local/bin/cmake -E cmake_progress_report
/home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp/CMakeFiles
1
Building CXX object
CMakeFiles/cmTryCompileExec583486650.dir/testCXXCompiler.cxx.o
/usr/bin/c++ -o
CMakeFiles/cmTryCompileExec583486650.dir/testCXXCompiler.cxx.o -c
/home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTryCompileExec583486650
/usr/local/bin/cmake -E cmake_link_script
CMakeFiles/cmTryCompileExec583486650.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/cmTryCompileExec583486650.dir/testCXXCompiler.cxx.o
-o cmTryCompileExec583486650 -rdynamic
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec583486650.dir/build.make:88: recipe for target
‘cmTryCompileExec583486650’ failed
make[2]: Leaving directory
‘/home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp’
make[2]: *** [cmTryCompileExec583486650] Error 1
Makefile:117: recipe for target ‘cmTryCompileExec583486650/fast’ failed
make[1]: *** [cmTryCompileExec583486650/fast] Error 2
make[1]: Leaving directory
‘/home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp’
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:216 (project)
– Configuring incomplete, errors occurred!
I also check the cmake version as follow.
cmake version 3.2.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
gcc version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.8/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: …/src/configure -v --with-pkgversion=‘Raspbian 4.8.2-21~rpi3rpi1’ --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.8.2 (Raspbian 4.8.2-21~rpi3rpi1)
I also try the sudo ldconfig. it is not work. plz help me T_T