Hi everyone, I'm trying to link a class with a library. The script is:

/bin/sh ${BOREALIS}/common/bin/libtool --mode=link --tag=CXX ${BOREALIS}/nmstl/bin/wtf g++ -g -Wall -o $1$app $1.o -L/home/vincenzo/software/borealis-projects/LoadDistributionTool -lwld

I get the error:

Linker errors follow. This mode is untested; type "wtf 0" for the original output.

cannot find -lwld
in /usr/bin/ld

ld returned 1 exit status
in collect2

Why is it searching that library in the wrong directory?

Thanks

Dani AI

Generated

A quick checklist and explanation tied to the replies above so the root cause is easier to find.

The linker message means the linker never found an actual library file named in the form the linker expects (typically libwld.so or libwld.a). Common causes are: the library file is not present or only the run-time soname is present (for example libwld.so.1 without a libwld.so symlink), a 32/64-bit mismatch, the -L directory was not actually passed to ld because a wrapper script reordered or dropped arguments, or libtool wanted a .la file and did not fall back. This addresses and and clarifies — hyphens inside directory names are usually harmless; a component that begins with - or unescaped spaces would be a problem.

Useful checks (replace /path/to/libdir with the actual directory):

ls -l /path/to/libdir/libwld*
file /path/to/libdir/libwld.so          # architecture / ELF type
readelf -h /path/to/libdir/libwld.so    # confirm ABI (32/64)
g++ -o tprog t.o -L/path/to/libdir -lwld   # try linking directly (bypass libtool)
g++ -Wl,-v -o tprog t.o -L/path/to/libdir -lwld  # shows ld search steps

If the ls shows only libwld.so.X.Y but not libwld.so, create the development symlink or install the devel package: ln -s libwld.so.X.Y libwld.so in that directory (or rebuild/install the library properly). If direct g++ linking works but the libtool wrapper fails, inspect the wrapper script passed to libtool (the wtf script mentioned) and run the libtool invocation with verbose tracing or run the build with set -x to see the exact ld command libtool invokes. libtool can consult .la metadata; if the library comes from a libtool-built tree, the .la file helps libtool locate dependencies.

For details on libtool behavior and linker options see the official docs:

If a full build script still claims a missing nmstl artifact (as noted), build and install that subproject first or point the build to the correct install prefix so libtool/gcc see its .so/.la files.

Recommended Answers

All 4 Replies

Maybe the - in your long path is confusing things.

u shure the library actually is at that path?

Are you positive you have the shared library in your
/home/vincenzo/software/borealis-projects/LoadDistributionTool ?

And what is this supposed to be ? ${BOREALIS}/nmstl/bin/wtf ? its not preceded by a libtool option.

I am trying to get the system working, the only remaining thing is that when I run the script borealis/utility/unix/ I got the error : Missing nmstl library (.../nmstl/lib) and there isn't any in the folder in which is supposed to be that library, even in the installation files and the folder ${HOME}/install_nmstl/ that is supposed to be created in the installation dont appears.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.