robamu-org / beaglebone-crosscompiling Goto Github PK
View Code? Open in Web Editor NEWCross-compiling and debugging C/C++ applications for the Raspberry Pi with CMake, the TCF-Agent and Eclipse
License: Apache License 2.0
Cross-compiling and debugging C/C++ applications for the Raspberry Pi with CMake, the TCF-Agent and Eclipse
License: Apache License 2.0
I added the following lines to BBBToolchain.cmake
for pkg-config to work properly:
# adjust pkg-config
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}\;${CMAKE_SYSROOT}/usr/lib/pkgconfig\;${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig\;${CMAKE_SYSROOT}/usr/share/pkgconfig")
set(ENV{PKG_CONFIG_LIBDIR} "${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig\;${CMAKE_SYSROOT}/usr/share/pkgconfig")
set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT})
# required on Windows - extra flag to pkg-config
if(WIN32)
set(PKG_CONFIG_ARGN "--dont-define-prefix")
endif(WIN32)
I have a project which contains find_package(CURL REQUIRED)
command. It fails during configure step and complains it cannot find header files for curl.
The package libcurl4-openssl-dev
is installed.
It appeared CMAKE_LIBRARY_ARCHITECTURE
was empty when rootfs path contained spaces. Some autodetection magic was broken by that. When I created a symlink and specified rootfs path without spaces, the configure step succeeded.
Either that should be fixed, or a warning must be given in the docs.
First of all, I actually use my own helloworld project with your toolchain file, but I'm not sure if it could make any difference.
I get the following error during CMake configure stage:
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.exe" --no-warn-unused-cli "-DCMAKE_MAKE_PROGRAM:STRING=C:/Users/azarubkin/Documents/Platformio Projects/ninja.exe" -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_TOOLCHAIN_FILE:FILEPATH=BBBToolchain.cmake "-Hc:/Users/azarubkin/Documents/Platformio Projects/helloworld" "-Bc:/Users/azarubkin/Documents/Platformio Projects/helloworld/build" -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Beagle Bone Black sysroot: C:/Users/azarubkin/Documents/beaglebone/rootfs
[cmake] -- No CROSS_COMPILE environmental variable set, using default ARM linux cross compiler name arm-linux-gnueabihf
[cmake] -- Using sysroot path: C:/Users/azarubkin/Documents/beaglebone/rootfs
[cmake] -- The CXX compiler identification is GNU 8.3.0
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - failed
[cmake] -- Check for working CXX compiler: C:/SysGCC/beaglebone/bin/arm-linux-gnueabihf-g++.exe
[cmake] -- Check for working CXX compiler: C:/SysGCC/beaglebone/bin/arm-linux-gnueabihf-g++.exe - broken
[cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeTestCXXCompiler.cmake:62 (message):
[cmake] The C++ compiler
[cmake]
[cmake] "C:/SysGCC/beaglebone/bin/arm-linux-gnueabihf-g++.exe"
[cmake]
[cmake] is not able to compile a simple test program.
[cmake]
[cmake] It fails with the following output:
[cmake]
[cmake] Change Dir: C:/Users/azarubkin/Documents/Platformio Projects/helloworld/build/CMakeFiles/CMakeTmp
[cmake]
[cmake] Run Build Command(s):C:/Users/AZARUB~1/DOCUME~1/PLATFO~1/ninja.exe cmTC_c1a52 && [1/2] Building CXX object CMakeFiles/cmTC_c1a52.dir/testCXXCompiler.cxx.o
[cmake] [2/2] Linking CXX executable cmTC_c1a52
[cmake] FAILED: cmTC_c1a52
[cmake] cmd.exe /C "cd . && C:\SysGCC\beaglebone\bin\arm-linux-gnueabihf-g++.exe --sysroot=C:/Users/azarubkin/Documents/beaglebone/rootfs -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard CMakeFiles/cmTC_c1a52.dir/testCXXCompiler.cxx.o -o cmTC_c1a52 && cd ."
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: warning: libm.so.6, needed by c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so, not found (try using -rpath or -rpath-link)
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `acos@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `hypot@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `cos@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `fmod@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `tan@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `atan@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `asin@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `sqrt@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `ceil@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `atan2@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `sin@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `tanh@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `sinh@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `pow@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `log@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `floor@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `log10@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `exp@GLIBC_2.4'
[cmake] c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/libstdc++.so: undefined reference to `cosh@GLIBC_2.4'
[cmake] collect2.exe: error: ld returned 1 exit status
[cmake] ninja: build stopped: subcommand failed.
The libraries search dirs obtained by calling C:\SysGCC\beaglebone\bin\arm-linux-gnueabihf-g++.exe --sysroot=C:/Users/azarubkin/Documents/beaglebone/rootfs -print-search-dirs
are:
libraries: =c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/;c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/;c:/sysgcc/beaglebone/bin/../lib/gcc/;c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/lib/arm-linux-gnueabihf/8/;c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/lib/arm-linux-gnueabihf/;c:/sysgcc/beaglebone/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/lib/;C:/Users/azarubkin/Documents/beaglebone/rootfs/lib/arm-linux-gnueabihf/8/;C:/Users/azarubkin/Documents/beaglebone/rootfs/lib/arm-linux-gnueabihf/;C:/Users/azarubkin/Documents/beaglebone/rootfs/lib/;C:/Users/azarubkin/Documents/beaglebone/rootfs/usr/lib/arm-linux-gnueabihf/8/;C:/Users/azarubkin/Documents/beaglebone/rootfs/usr/lib/arm-linux-gnueabihf/;C:/Users/azarubkin/Documents/beaglebone/rootfs/usr/lib/
The file libm.so.6
is located in C:\Users\azarubkin\Documents\beaglebone\rootfs\lib\arm-linux-gnueabihf
, which is in the list, but why the linker cannot find it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.