Closed emptor8 closed 3 years ago
The CMAKE_C_COMPILER:
~/cmake-test/tools/cross-pi-gcc-8.3.0-2/bin/arm-linux-gnueabihf-gcc is not a full path to an existing compiler tool.
The CMAKE_CXX_COMPILER:
~/cmake-test/tools/cross-pi-gcc-8.3.0-2/bin/arm-linux-gnueabihf-g++ is not a full path to an existing compiler tool.
@jteng7
Did you checked if this file paths ~/cmake-test/tools/cross-pi-gcc-8.3.0-2/bin/arm-linux-gnueabihf-gcc
and ~/cmake-test/tools/cross-pi-gcc-8.3.0-2/bin/arm-linux-gnueabihf-g++
exists or not?
You can check this by running:
~/cmake-test/tools/cross-pi-gcc-8.3.0-2/bin/arm-linux-gnueabihf-gcc --version
~/cmake-test/tools/cross-pi-gcc-8.3.0-2/bin/arm-linux-gnueabihf-g++ --version
And, check if all dependencies are installed: https://github.com/abhiTronix/raspberry-pi-cross-compilers/wiki/Cross-Compiler-CMake-Usage-Guide-with-rsynced-Raspberry-Pi-32-bit-OS#1-update-the-host-machine
Also, Follow the docs carefully.
Both paths exist:
Also, I double-checked all dependencies are installed.
One thing I noticed in the docs is I had to create a CMakeLists.txt file, not CMakeList.txt file (note the plural) -- is that an error in the docs?
An update: I got it working!
Changes I had to make:
set(tools /home/test/cmake-test/tools/cross-pi-gcc-8.3.0-2)
works but set(tools ~/cmake-test/tools/cross-pi-gcc-8.3.0-2)
does NOT work.In PI.cmake, I had to change the tools and rootfs_dir paths to point to the full path (i.e. replace the tilde with the actual path with the home directory). For example, set(tools /home/test/cmake-test/tools/cross-pi-gcc-8.3.0-2) works but set(tools ~/cmake-test/tools/cross-pi-gcc-8.3.0-2) does NOT work.
@jteng7 Aren't you running Linux?
In CMakeLists.txt, I had to change the second parameter of add_executable to main.cpp instead of foo.cpp, to match the file to compile
Thanks I'll change it.
One thing I noticed in the docs is I had to create a CMakeLists.txt file, not CMakeList.txt file (note the plural) -- is that an error in the docs?
It should be CMakeLists.txt
.
@jteng7 Can you try set(tools $ENV{HOME}/cmake-test/tools/cross-pi-gcc-8.3.0-2)
instead of set(tools /home/test/cmake-test/tools/cross-pi-gcc-8.3.0-2)
?
Thanks, Docs updated.
In PI.cmake, I had to change the tools and rootfs_dir paths to point to the full path (i.e. replace the tilde with the actual path with the home directory). For example, set(tools /home/test/cmake-test/tools/cross-pi-gcc-8.3.0-2) works but set(tools ~/cmake-test/tools/cross-pi-gcc-8.3.0-2) does NOT work.
@jteng7 Aren't you running Linux?
Yeah, but one wrinkle is I'm running Ubuntu through VMWare, so that might be a reason for the issues I'm seeing?
@jteng7 Can you try
set(tools $ENV{HOME}/cmake-test/tools/cross-pi-gcc-8.3.0-2)
instead ofset(tools /home/test/cmake-test/tools/cross-pi-gcc-8.3.0-2)
?
Thanks - using this works as well 👍
I'm seeing the following errors below when I try to build the Hello World project from here: https://github.com/abhiTronix/raspberry-pi-cross-compilers/wiki/Cross-Compiler-CMake-Usage-Guide-with-rsynced-Raspberry-Pi-32-bit-OS#cross-compiler-cmake-usage-guide-with-rsynced-raspberry-pi-32-bit-os
Do you know what could be wrong?