Hi @eladg1,
please try following my steps to successfully build and run your test: on host:
create main.cpp (or any file name you want) with the mentioned code content
execute: ~/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_DDPX/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ main.cpp -o test
copy test executable to DDPX platform (for example XavierA) using ssh: scp test nvidia@<XavierA IP>:~/
on target:(Xavier A)
execute:
./test
the output is:
Obtained 5 stack frames.
./test() [0x400780]
./test() [0x40080c]
./test() [0x400824]
/lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0xe0) [0x7fa5fa26e0]
./test() [0x400698]
please try and figure out what is different in your cmake file that differs from this example.
I suggest you start by looking for how to set the cross-compiler location (gnu compiler mentioned above)
I know exactly what causes the problem to occur. It’s because I’m using find_package(Backtrace REQUIRED) in my cmake file. Running the same cmake w/o this line compiles just fine.
But the strange thing is, when compiling with this line in the cmake on the pegasus, it succeeds to compile.
the reason for that is that CMake searches for libraries and includes in the build system sysroot only - meaning in the host sysroot when crosscompiling (so libraries for cross-compiling will not be found) and in the pegasus sysroot when native compiling.
you might want to try using Find<package>.cmake file located within your project and use it by using
where cmake is usually the name of the folder we set to have all the user-defined package finders.
you will find the include file execinfo.h for the PEGASUS in here: ~/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_DDPX/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/include