weinzierl-engineering / baos

BAOS SDK - http://weinzierl-engineering.github.io/baos
MIT License
40 stars 18 forks source link

compilation problem on Raspberry Pi 4 #18

Closed leopitrera closed 8 months ago

leopitrera commented 3 years ago

Hello, I write this command in a Raspberry Pi 4: cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/raspbian-toolchain.cmake -DWZSDK_SAMPLES=1 -DWZSDK_STATIC=1 -G "Unix Makefiles" ../

But these errors have appeared:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /opt/toolchains/raspberrypi/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /opt/toolchains/raspberrypi/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/opt/toolchains/raspberrypi/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/pi/baosSDK/baos/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make cmTC_fd10a/fast && /usr/bin/make -f CMakeFiles/cmTC_fd10a.dir/build.make CMakeFiles/cmTC_fd10a.dir/build
    make[1]: se entra en el directorio '/home/pi/baosSDK/baos/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_fd10a.dir/testCCompiler.c.o
    /opt/toolchains/raspberrypi/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc   -isystem /opt/toolchains/raspberrypi/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/include -fPIC    -o CMakeFiles/cmTC_fd10a.dir/testCCompiler.c.o   -c /home/pi/baosSDK/baos/build/CMakeFiles/CMakeTmp/testCCompiler.c
    /opt/toolchains/raspberrypi/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc: 1: /opt/toolchains/raspberrypi/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc: Syntax error: "(" unexpected
    make[1]: *** [CMakeFiles/cmTC_fd10a.dir/build.make:66: CMakeFiles/cmTC_fd10a.dir/testCCompiler.c.o] Error 2
    make[1]: se sale del directorio '/home/pi/baosSDK/baos/build/CMakeFiles/CMakeTmp'
    make: *** [Makefile:121: cmTC_fd10a/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:13 (project)

-- Configuring incomplete, errors occurred!
See also "/home/pi/baosSDK/baos/build/CMakeFiles/CMakeOutput.log".
See also "/home/pi/baosSDK/baos/build/CMakeFiles/CMakeError.log".

What I can do to solve it? Thank you

weinzierl-engineering commented 3 years ago

Is it correct to assume that your are trying to compile directly on the Raspberry Pi? If so, you should use the cmake -DCMAKE_BUILD_TYPE=Release -DWZSDK_STATIC=1 -DWZSDK_SAMPLES=1 -DWZSDK_SAMPLES_QT=0 -G "Unix Makefiles" ../ command. The -DCMAKE_TOOLCHAIN_FILE=../cmake/raspbian-toolchain.cmake part is for cross compiling on a linux desktop machine. For this a cross compile toolchain is required and excepted at the location /opt/toolchains/raspberrypi/...

Hope that helps.

weinzierl-engineering commented 8 months ago

Closed due to inactivity.