robotology / icub-tutorials

Tutorials on iCub code
19 stars 9 forks source link

Linking issue: "/usr/bin/ld: cannot find -lportaudio" #1

Closed johnnass closed 8 years ago

johnnass commented 8 years ago

Hello, I am working on iCub head and want to compile an example code similar to one provided in the tutorial (see tutorial_arm.cpp).

Then I came across the following error while linking:

icub@icubsrv:~/icub-tutorials/motor-control-move-head$ make
[100%] Building CXX object CMakeFiles/move_head.dir/move_head.cpp.o
Linking CXX executable move_head
/usr/bin/ld: cannot find -lportaudio
collect2: ld returned 1 exit status
make[2]: *** [move_head] Error 1
make[1]: *** [CMakeFiles/move_head.dir/all] Error 2
make: *** [all] Error 2

Can you please tell me how to find the library portaudio or solve the problem?

Thank you :)

lornat75 commented 8 years ago

Hi, looks like you have compiled the portaudio device in YARP but that the portaudio library is not available. The first thing I would do is to recompile yarp without portaudio, then see if the problem persists. If it doesn’t (as I think), try re-enabling portaudio support in YARP and rebuild.

johnnass commented 8 years ago

Hi,

Thank you for the answer. I recompiled YARP, then back to compile the example. Got a new error:

make[2]: *** No rule to make target `/usr/local/src/robot/yarp/build/lib/libYARP_OS.a', needed by `move_head'.  Stop.
make[1]: *** [CMakeFiles/move_head.dir/all] Error 2
make: *** [all] Error 2

I found this library in /usr/local/src/robot/yarp/lib, then I copied the library into /usr/local/src/robot/yarp/build/lib, then recompiled ... Similar issue with libYARP_sig.a, I did the same (copied it from /usr/local/src/robot/yarp/lib into /usr/local/src/robot/yarp/build/lib), and recompiled.

make[2]: *** No rule to make target `/usr/local/src/robot/yarp/build/lib/libYARP_math.a', needed by `move_head'.  Stop.
make[1]: *** [CMakeFiles/move_head.dir/all] Error 2
make: *** [all] Error 2

After searching, I did not find the requested library libYARP_math.a :(

Do I need to install yarp again? Thank you

lornat75 commented 8 years ago

Did you clean the cmake cache and rebuilt icub-tutorial and icub-main?

johnnass commented 8 years ago

Hi, It works now. Thank you for the fast reply :)