usr/bin/ld: cannot find -l nameOfTheLibrary
If your library name is say libxyz.so
and it is located on path say:
/home/user/myDir
then to link it to your program:
g++ -L/home/user/myDir -lxyz myprog.cpp -o myprog
How to avoid cannot find -lR for R Package installation on windows
You are making three mistakes:
- You should not install rtools under
program files
or any other path with a space. - You are using
BINPREF
wrong, causing the 64-bit toolchain to be used on 32-bit. - The mingw gcc dirs should not be on the PATH. Only the
bin
dir (bash
andmake
) should be.
Recommended setup:
It is highly recommended to install rtools in the default location C:\Rtools\
. This is the only configuration that is widely tested.
In this case you only need to make put C:\Rtools\bin
is on the PATH in order to compile packages. R will automatically use the correct compilers on 32-bit and 64-bit.
With non-default Rtools location:
If you really must install rtools in a non standard location, you can set BINPREF
to a pattern that includes $(WIN)
that gets expanded to the correct path for example like so:
Sys.setenv(BINPREF="C:/YourRtoolsPath/mingw_$(WIN)/bin/")
When make
invokes the compiler, $(WIN)
gets substituted by either 32
or 64
which should then resolve to the correct path of the respective toolchain.
/usr/bin/ld: cannot find during linking g++
ld
's manual page describes the -l
option as follows (irrelevant details omitted):
-l namespec
--library=namespec
Add the archive or object file specified by namespec to the list of
files to link. [...] ld will search a directory for a library called
libnamespec.so
If you read this very carefully, you will reach the conclusion that -llibclickhouse-cpp-lib
instructs ld
to search for a library named liblibclickhouse-cpp-lib.so
which, obviously, does not exist.
This should simply be -lclickhouse-cpp-lib
.
/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.
ld cannot find shared library even with -L specified
but ld cannot seem to find it
This command line: gcc ... -lInsertTimingInstr.so ...
asks the linker to link against libInsertTimingInstr.so.a
or libInsertTimingInstr.so.so
, neither of which exists.
You want: gcc ... -lInsertTimingInstr ...
(i.e. drop the lib
prefix and the .so
suffix).
Alternatively, you could do this: gcc ... /home/user/cuda_sync_analyzer-install/lib/libInsertTimingInstr.so ...
/usr/bin/ld: cannot find -lauparse
You need audit-libs-devel
. Here's how I found that:
$ sudo dnf install /usr/lib64/libauparse.so
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
audit-libs-devel x86_64 2.7.7-1.fc26 updates-testing 81 k
In general:
- Libraries are gonna be in
/usr/lib64
on x86_64 systems. -lsomething
means to look for/usr/lib64/libsomething.so
- And DNF has this neat feature where it can find things by file, so there you go.
- Also, for most libraries on Fedora, there's a runtime package (here,
audit-libs
and then a devel package (audit-libs-devel
) which contains the.so
symlink and usually header files and stuff.
Related Topics
Check for Installed Packages Before Running Install.Packages()
How to Find All Functions in an R Package
How to Add a General Label to Facets in Ggplot2
How to Install an R Package from the Source Tarball on Windows
Pasting Elements of Two Vectors Alphabetically
How to Calculate Combination and Permutation in R
How to Get a Reversed, Log10 Scale in Ggplot2
R - Add Column That Counts Sequentially Within Groups But Repeats for Duplicates
How to Get the Classes of All Columns in a Data Frame
Lib Unspecified & Error in Loadnamespace
How to Wait for a Keypress in R
Make Conditionalpanel Depend on Files Uploaded with Fileinput
Add Multiple Columns to R Data.Table in One Function Call
Count Number of Zeros Per Row, and Remove Rows with More Than N Zeros
Remove Ids That Occur X Times R
Avoid Ggplot Sorting the X-Axis While Plotting Geom_Bar()