Linking error with creating new sample program - undefined reference
1037 2 2022-6-30
Uploading and Loding Picture ...(0/1)
o(^-^)o
M300 RTK Newbie
lvl.1

United States
Offline

I am using a Linux Ubuntu 18.04 and have downloaded and run the sample programs from the dji OSDK github.
Now I am trying to create a new sample program and am having trouble linking up the files.



I have attatched my CMakeLists.txt file. Below is the error message

orbit10@orbit10-desktop:~/Onboard-SDK/sample/platform/linux/Combined/build$ make-- Configuring done
-- Generating done
-- Build files have been written to: /home/orbit10/Onboard-SDK/sample/platform/linux/Combined/build
[ 50%] Linking CXX executable transform
CMakeFiles/transform.dir/helper-functions.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
/home/orbit10/Onboard-SDK/osdk-core/api/inc/dji_version.hpp:91: undefined reference to `DJI::OSDK::Version::FW(unsigned char, unsigned char, unsigned char, unsigned char)'
/home/orbit10/Onboard-SDK/osdk-core/api/inc/dji_version.hpp:100: undefined reference to `DJI::OSDK::Version::FW(unsigned char, unsigned char, unsigned char, unsigned char)'
/home/orbit10/Onboard-SDK/osdk-core/api/inc/dji_version.hpp:107: undefined reference to `DJI::OSDK::Version::FW(unsigned char, unsigned char, unsigned char, unsigned char)'
CMakeFiles/transform.dir/helper-functions.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
/home/orbit10/Onboard-SDK/osdk-core/utility/inc/dji_singleton.hpp:80: undefined reference to `DJI::OSDK:og:og(Mutex*)'
collect2: error: ld returned 1 exit status
CMakeFiles/transform.dir/build.make:161: recipe for target 'transform' failed
make[2]: *** [transform] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/transform.dir/all' failed
make[1]: *** [CMakeFiles/transform.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2




What is causing the undefined reference error? Are there any other files I should include?

Thanks!





2022-6-30
Use props
M300 RTK Newbie
lvl.1

United States
Offline

2022-6-30
Use props
M300 RTK Newbie
lvl.1

United States
Offline

I ended up changing my cmake file to look more like this one: https://stackoverflow.com/questions/67429895/how-to-create-cmakelist-txt-for-onboard-sdk-project-on-debian-10
2022-7-5
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules