ld warning: lib-xyz, needed by lib-abc – Cross Comp Rasp Pi

Sysprogs forums Forums VisualGDB ld warning: lib-xyz, needed by lib-abc – Cross Comp Rasp Pi

This topic contains 4 replies, has 2 voices, and was last updated by  ket 7 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #577

    Silvio
    Participant

    Hi,

    I’m trying to evaluate VisualGDB. I use VS2012(Update 2) and the latest VisualGDB trial version and would like to cross-compile a project for a raspberry pi device.
    Unfortunately, I have some problems with linking of libraries, especially library dependencies.
    In the project I use the OpenCV library, which was compiled on the raspberry itself. If I build the project, in the log-file the linker misses a OpenCV library, so I added it to the “LIBRARY_NAMES” flag.

    #Additional flags

    LIBRARY_NAMES :=opencv_highgui

    So far so good 🙂

    Now the linker complains missing another library that is needed by the previously added lib:
    … ld.exe : warning : libgtk-x11-2.0.so.0, needed by C:SysGCCraspberryarm-linux-gnueabihfsysrootusrlocalopencvlib/libopencv_highgui.so, not found (try using -rpath or -rpath-link)

    Next, I added the missing library, libgtk-x11-2.0 and compiled again.

    Now the linker misses further libraries that are needed by libgtk-x11-2.0:
    … ld.exe : warning : libopencv_imgproc.so.2.4, needed by C:SysGCCraspberryarm-linux-gnueabihfsysrootusrlocalopencvlib/libopencv_highgui.so, not found (try using -rpath or -rpath-link)
    … ld.exe : warning : libgtk-x11-2.0.so.0, needed by C:SysGCCraspberryarm-linux-gnueabihfsysrootusrlocalopencvlib/libopencv_highgui.so, not found (try using -rpath or -rpath-link)

    Is there a way that the linker can find the libraries without adding all “second level” depended libraries? Or do I missing some option?
    I’m afraid this will be otherwise an endless story to insert all libraries by hand 

    Thanks,
    Silvio

    #2438

    ket
    Participant

    Hi,

    Others have reported similar issues (viewtopic.php?f=5&t=2648), you do need to specify the second-level libraries as well. The cross-toolchain linker has issues locating the libraries with the usual root folder not being there and some libraries having absolute path dependencies within them.

    In the past with OpenCV the following library names list was successful:

    Then we also needed to specify some libraries with absolute paths:

    Try the above settings with your project.

    #2439

    Silvio
    Participant

    Hi Ket,

    good work, this solved the problem.

    Thanks very much!

    Some hint for other using this solution:
    remove the last backslash from the last line “$(SYSROOT)/lib/arm-linux-gnueabihf/libgpg-error.so.0 ” (seems a copy typo)

    best wishes,
    Silvio

    #2440

    Silvio
    Participant

    Hi Ket,

    unfortunately there is a little problem if I try to change some make file options via the “VisualGDB Project Properties – > Makefile settings”.
    After hitting the Apply button visual gdb tries to build a test application. During the linking the following error occurs:

    arm-linux-gnueabihf-gcc.exe: error: $(SYSROOT)/lib/arm-linux-gnueabihf/librt.so.1: No such file or directory
    arm-linux-gnueabihf-gcc.exe: error:

    For me that is not a critical problem because a can change the settings directly in the *.mak file, but seems that this is maybe a bug.

    best wihes
    Silvio

    #2441

    ket
    Participant

    Hi,

    Thanks for reporting this. We are planning on adding at least an ignore option to the settings toolchain testing in 4.1.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.