Ask Your Question

Problem with Linking SDL when compiling ardrone_brown node

asked 2012-05-31 19:26:22 -0500

liangfok gravatar image

updated 2014-01-28 17:12:32 -0500

ngrennan gravatar image

When attempting to compile the ardrone_brown node using "rosmake", I get errors indicating that the SDL library is not being linked as shown below.

 Linking CXX executable ../bin/ardrone_driver
  /home/liang/brown-ros-pkg-read-only/experimental/ardrone_brown/lib/libsdk.a(vp_stages_o_sdl.o): In function `thread_escaper':
  vp_stages_o_sdl.c:(.text+0x69): undefined reference to `SDL_PollEvent'
  /home/liang/brown-ros-pkg-read-only/experimental/ardrone_brown/lib/libsdk.a(vp_stages_o_sdl.o): In function `vp_stages_output_sdl_stage_open':
  vp_stages_o_sdl.c:(.text+0xb7): undefined reference to `SDL_Init'
  /home/liang/brown-ros-pkg-read-only/experimental/ardrone_brown/lib/libsdk.a(vp_stages_o_sdl.o): In function `vp_stages_output_sdl_stage_transform':
  vp_stages_o_sdl.c:(.text+0x1a8): undefined reference to `SDL_SetVideoMode'
  vp_stages_o_sdl.c:(.text+0x1b7): undefined reference to `SDL_ShowCursor'
  vp_stages_o_sdl.c:(.text+0x1d8): undefined reference to `SDL_CreateYUVOverlay'
  vp_stages_o_sdl.c:(.text+0x264): undefined reference to `SDL_LockYUVOverlay'
  vp_stages_o_sdl.c:(.text+0x404): undefined reference to `SDL_UnlockYUVOverlay'
  vp_stages_o_sdl.c:(.text+0x417): undefined reference to `SDL_DisplayYUVOverlay'
  /home/liang/brown-ros-pkg-read-only/experimental/ardrone_brown/lib/libsdk.a(vp_stages_o_sdl.o): In function `vp_stages_output_sdl_stage_close':
  vp_stages_o_sdl.c:(.text+0x52c): undefined reference to `SDL_ShowCursor'
  vp_stages_o_sdl.c:(.text+0x537): undefined reference to `SDL_FreeYUVOverlay'
  vp_stages_o_sdl.c:(.text+0x542): undefined reference to `SDL_FreeSurface'
  vp_stages_o_sdl.c:(.text+0x547): undefined reference to `SDL_Quit'
  collect2: ld returned 1 exit status

I'm using Ubuntu 12.04 and ROS Fuerte. libsdl1.2-dev is installed, linkable, and usable by other (non-ROS) programs. Looking in the CMakeLists.txt within the ardrone_brown node's root directory, the following line is at the very bottom, which I think tells the compiler to link SDL.

target_link_libraries(ardrone_driver vlib pc_ardrone SDL sdk)

Is there something I'm missing? Any ideas what could be wrong?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-06-01 06:57:23 -0500

liangfok gravatar image

The problem was worked around by moving SDL to the end of the target_link_libraries(...) list in CMakeLists.txt. This solution was described here:

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-05-31 19:26:22 -0500

Seen: 1,186 times

Last updated: May 31 '12