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

compile bebop_driver failed #172

Open
tc17339 opened this issue Sep 3, 2018 · 2 comments
Open

compile bebop_driver failed #172

tc17339 opened this issue Sep 3, 2018 · 2 comments

Comments

@tc17339
Copy link

tc17339 commented Sep 3, 2018

Hi everyone

There was a problem I cannot fixed them.

When I used 'catkin built' as the last step to build bebop_autonomy, it gives me this error:

/usr/bin/ld: /usr/local/lib/libavcodec.a(mqc.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [/home/taochen/bebop_ws/devel/.private/bebop_driver/lib/libbebop.so] Error 1
make[1]: *** [CMakeFiles/bebop.dir/all] Error 2
make: *** [all] Error 2
cd /home/taochen/bebop_ws/build/bebop_driver; catkin build --get-env bebop_driver | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -
...............................................................................
Failed << bebop_driver:make [ Exited with code 2 ]
Failed <<< bebop_driver [ 30.5 seconds ]
Abandoned <<< bebop_tools [ Unrelated job failed ]
[build] Summary: 2 of 4 packages succeeded.
[build] Ignored: 1 packages were skipped or are blacklisted.
[build] Warnings: None.
[build] Abandoned: 1 packages were abandoned.
[build] Failed: 1 packages failed.
[build] Runtime: 33.0 seconds total.

It still no works when I add the 'set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )' in the CMakeList.txt file which was located in the bebop_dirver folder.
I also have tried command 'set(Boost_USE_STATIC_LIBS OFF) set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)'. but still get the same error.
Anyone know how to fix the error?

Many thanks
Tao

@gsilano
Copy link
Contributor

gsilano commented Sep 3, 2018

This issue has been fixed in #164. Maybe, such changes were not reported in the master.

@tc17339
Copy link
Author

tc17339 commented Sep 4, 2018

But it gives me these errors this time:
/home/taochen/bebop_ws/src/bebop_autonomy/bebop_driver/src/bebop_video_decoder.cpp:93:36: error: ‘CODEC_CAP_TRUNCATED’ was not declared in this scope
if (codec_ptr_->capabilities & CODEC_CAP_TRUNCATED)
^
/home/taochen/bebop_ws/src/bebop_autonomy/bebop_driver/src/bebop_video_decoder.cpp:95:32: error: ‘CODEC_FLAG_TRUNCATED’ was not declared in this scope
codec_ctx_ptr_->flags |= CODEC_FLAG_TRUNCATED;
^
/home/taochen/bebop_ws/src/bebop_autonomy/bebop_driver/src/bebop_video_decoder.cpp:97:31: error: ‘CODEC_FLAG2_CHUNKS’ was not declared in this scope
codec_ctx_ptr_->flags2 |= CODEC_FLAG2_CHUNKS;
^
After I added 'AV' prefix to them: AV_CODEC_CAP_TRUNCATED,AV_CODEC_FLAG_TRUNCATED,AV_CODEC_FLAG2_CHUNKS;

The compiler gives me this error:
/usr/bin/ld: /usr/local/lib/libavcodec.a(mqc.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [/home/taochen/bebop_ws/devel/.private/bebop_driver/lib/libbebop.so] Error 1
make[1]: *** [CMakeFiles/bebop.dir/all] Error 2
make: *** [all] Error 2

and the I added:
add_compile_options(-fPIC);set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" ) to the CMakeList.txt file,Each time before I run catkin build, I have run catkin clean command, but still has this error. so I really have no idea how to do next step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants