"/Usr/Bin/Ld: Cannot Find -Lz"

/usr/bin/ld: cannot find -lliburing

You can fix this error by replacing -lliburing with -luring

gcc liburing-test.c -o liburing-test -luring

Is lib{library name}.a / .so a naming convention for static libraries in Linux?

/usr/bin/ld: cannot find

Add -L/opt/lib to your compiler parameters, this makes the compiler and linker search that path for libcalc.so in that folder.

Linker error: /usr/bin/ld: cannot find -lcudart_static while trying to compile CUDA code with clang

So I found a solution. Apparently the linker wasnt able to locate libcudart binary. So used find to get its location:

find /usr/ -name libcudart_static*

Got its path as:

/usr/local/cuda-11.6/targets/x86_64-linux/lib/libcudart_static.a

(might be different for you).

Just linked this path by using -L flag in the compilation command.
New command:

clang++ axpy.cu -o exec --cuda-gpu-arch=sm_60 -L/usr/local/cuda -L/usr/local/cuda-11.6/targets/x86_64-linux/lib/ -lcudart_static -ldl -lrt -pthread

libcheck fails with /usr/bin/ld: cannot find @CHECK_CFLAGS@: No such file or directory

The @CHECK_CFLAGS@ and @CHECK_LIBS@ strings appearing in your Makefile.am are placeholders for the values of Autoconf output variables, but your original configure.ac does not contain anything that would set such output variables. As a result, the placeholders are carried through unchanged to generated makefiles, where they cause builds to fail with the observed error.

The Check documentation contains a section about integrating libcheck with Autotools-based build systems. Its recommendation is to use the the PKG_CHECK_MODULES provided by pkg-config. For example,

# ...

# Checks for libraries.
PKG_CHECK_MODULES([CHECK], [check >= 0.9.6])

# ...

The second macro parameter specifies the minimum acceptable version of Check, and it may be omitted if you do not wish to specify a minimum version.

Note also that older versions of PKG_CHECK_MODULES do not automatically make the relevant variables Autoconf output variables. If you were saddled with such a version and were unable to update, then you would also want to add

AC_SUBST([CHECK_CFLAGS])
AC_SUBST([CHECK_LIBS])

after PKG_CHECK_MODULES.

If you do not have pkg-config or do not want your package build to rely on it then there is also an AM_PATH_CHECK() macro provided by Check itself that can serve the purpose. That macro is deprecated, however, and therefore may be removed from some future version of Check. Refer to the documentation for more information on this macro.



Related Topics



Leave a reply



Submit