Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while building example: takeoff_and_land #1

Closed
shakthi-prashanth-m opened this issue Jun 21, 2017 · 5 comments
Closed

Error while building example: takeoff_and_land #1

shakthi-prashanth-m opened this issue Jun 21, 2017 · 5 comments
Labels

Comments

@shakthi-prashanth-m
Copy link
Contributor

shakthi-prashanth-m commented Jun 21, 2017

Hi Julian, I did build DroneLink as mentioned. I wanted to try running example. Got below error.
Could you please check ?

~/DroneLink/example$ make
[  3%] Built target gtest
[  6%] Built target gtest_main
[ 56%] Built target dronelink
[ 57%] Building CXX object CMakeFiles/integration_tests_runner.dir/integration_tests/curl.cpp.o
/home/shakthi/DroneLink/integration_tests/curl.cpp:10:25: error: ‘testing’ has not been declared
 class CurlTest : public testing::Test
                         ^
/home/shakthi/DroneLink/integration_tests/curl.cpp:10:34: error: expected ‘{’ before ‘Test’
 class CurlTest : public testing::Test
                                  ^
/home/shakthi/DroneLink/integration_tests/curl.cpp:12:1: error: expected primary-expression before ‘protected’
 protected:
 ^
/home/shakthi/DroneLink/integration_tests/curl.cpp:12:1: error: expected ‘}’ before ‘protected’
/home/shakthi/DroneLink/integration_tests/curl.cpp:12:1: error: expected ‘,’ or ‘;’ before ‘protected’
/home/shakthi/DroneLink/integration_tests/curl.cpp:18:24: error: ‘virtual’ outside class declaration
     virtual void SetUp()
                        ^
/home/shakthi/DroneLink/integration_tests/curl.cpp: In function ‘void SetUp()’:
/home/shakthi/DroneLink/integration_tests/curl.cpp:20:15: error: ‘clean’ was not declared in this scope
         clean();
               ^
/home/shakthi/DroneLink/integration_tests/curl.cpp:21:9: error: ‘_file_url_existing_http’ was not declared in this scope
         _file_url_existing_http =
         ^
/home/shakthi/DroneLink/integration_tests/curl.cpp: At global scope:
/home/shakthi/DroneLink/integration_tests/curl.cpp:29:27: error: ‘virtual’ outside class declaration
     virtual void TearDown()
                           ^
/home/shakthi/DroneLink/integration_tests/curl.cpp: In function ‘void TearDown()’:
/home/shakthi/DroneLink/integration_tests/curl.cpp:31:15: error: ‘clean’ was not declared in this scope
         clean();
               ^
/home/shakthi/DroneLink/integration_tests/curl.cpp: At global scope:
/home/shakthi/DroneLink/integration_tests/curl.cpp:45:1: error: expected declaration before ‘}’ token
 };
 ^
CMakeFiles/integration_tests_runner.dir/build.make:422: recipe for target 'CMakeFiles/integration_tests_runner.dir/integration_tests/curl.cpp.o' failed
make[2]: *** [CMakeFiles/integration_tests_runner.dir/integration_tests/curl.cpp.o] Error 1
CMakeFiles/Makefile2:69: recipe for target 'CMakeFiles/integration_tests_runner.dir/all' failed
make[1]: *** [CMakeFiles/integration_tests_runner.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Thanks

@julianoes
Copy link
Collaborator

It looks like you are not following the exact instructions to compile the example, can you please follow again the steps written in https://github.com/PX4/DroneLink#example.

@shakthi-prashanth-m
Copy link
Contributor Author

shakthi-prashanth-m commented Jun 22, 2017

Hi Julian, thanks for the comment. make default install was missing before. So build failed.

I get below linker error. libdronlink.a doesn't seem to be linked pthread library.

Scanning dependencies of target takeoff_and_land
[ 50%] Linking CXX executable takeoff_and_land
../install/lib/libdronelink.a(udp_connection.cpp.o): In function `std::thread::thread<void (&)(dronelink::UdpConnection*), dronelink::UdpConnection*>(void (&)(dronelink::UdpConnection*), dronelink::UdpConnection*&&)':
udp_connection.cpp:(.text._ZNSt6threadC2IRFvPN9dronelink13UdpConnectionEEJS3_EEEOT_DpOT0_[_ZNSt6threadC5IRFvPN9dronelink13UdpConnectionEEJS3_EEEOT_DpOT0_]+0x93): undefined reference to `pthread_create'
../install/lib/libdronelink.a(device_impl.cpp.o): In function `std::thread::thread<void (&)(dronelink::DeviceImpl*), dronelink::DeviceImpl*>(void (&)(dronelink::DeviceImpl*), dronelink::DeviceImpl*&&)':
device_impl.cpp:(.text._ZNSt6threadC2IRFvPN9dronelink10DeviceImplEEJS3_EEEOT_DpOT0_[_ZNSt6threadC5IRFvPN9dronelink10DeviceImplEEJS3_EEEOT_DpOT0_]+0x93): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/takeoff_and_land.dir/build.make:95: recipe for target 'takeoff_and_land' failed
make[2]: *** [takeoff_and_land] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/takeoff_and_land.dir/all' failed
make[1]: *** [CMakeFiles/takeoff_and_land.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

After making these changes, it is built successfully.

Kindly check.
Thanks

@julianoes
Copy link
Collaborator

@shakthi-prashanth-m strange, do you follow exactly these steps?

cd example/
mkdir build && cd build
cmake ..
make && ./takeoff_and_land

@shakthi-prashanth-m
Copy link
Contributor Author

dronelink_build_issue
Yes. Please find attachment.

@julianoes
Copy link
Collaborator

Ok thanks, I'm able to reproduce it.

@julianoes julianoes added the bug label Aug 29, 2017
shakthi-prashanth-m pushed a commit that referenced this issue Jan 10, 2018
1. This commit address DroneCore issue #221.
2. Corresponding changes (from #1 above) in integration tests & example.
3. Replaces boost::bind by std::bind.
4. Adds important note about using Boost in the example.
5. Adds debug_str to distinguish FollowMe plugin debug messages.
shakthi-prashanth-m pushed a commit that referenced this issue Jan 11, 2018
1. This commit address DroneCore issue #221.
2. Corresponding changes (from #1 above) in integration tests & example.
3. Replaces boost::bind by std::bind.
4. Adds important note about using Boost in the example.
5. Adds debug_str to distinguish FollowMe plugin debug messages.
julianoes pushed a commit that referenced this issue Jan 11, 2018
1. This commit address DroneCore issue #221.
2. Corresponding changes (from #1 above) in integration tests & example.
3. Replaces boost::bind by std::bind.
4. Adds important note about using Boost in the example.
5. Adds debug_str to distinguish FollowMe plugin debug messages.
rt-2pm2 pushed a commit to rt-2pm2/DronecodeSDK that referenced this issue Nov 27, 2018
1. This commit address DroneCore issue mavlink#221.
2. Corresponding changes (from mavlink#1 above) in integration tests & example.
3. Replaces boost::bind by std::bind.
4. Adds important note about using Boost in the example.
5. Adds debug_str to distinguish FollowMe plugin debug messages.
julianoes pushed a commit that referenced this issue Aug 5, 2019
JonasVautherin pushed a commit that referenced this issue Oct 13, 2020
dlech referenced this issue in dlech/MAVSDK Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants