Cant find library in /usr/bin/ld

0 votes

Whenever I try and compile my program, it gives me this error. also I'm using g++ commands:

usr/bin/ld: cannot find -l<nameOfTheLibrary>

I've created a symlink to my library lcated in the other directory. Is there anything else I need to do to make this work?

Mar 26, 2019 in Linux Administration by Damon Salvatore
• 5,540 points
1,635 views

1 answer to this question.

0 votes

Say your library "libxyz.so" is located in:

/home/user/myDir

then link it to your program using:

g++ -L/home/user/myDir -lxyz myprog.cpp -o myprog
answered Mar 26, 2019 by ajs3033
• 7,280 points

Related Questions In Linux Administration

0 votes
1 answer

How to find path of software installed in Linux?

There are multiple ways to find the ...READ MORE

answered May 19, 2019 in Linux Administration by Rishi
782 views
0 votes
1 answer
0 votes
1 answer

How to find the group associated with a user in linux?

To list all the groups groups or to list ...READ MORE

answered Jun 20, 2019 in Linux Administration by DareDev
• 6,850 points
116 views
0 votes
2 answers

How do I find all files containing specific text and rename in unix/linux

Hi, @Kal You can use this command below to ...READ MORE

answered Jul 2, 2019 in Linux Administration by Gitika
• 29,170 points

edited Jul 2, 2019 by Gitika 144 views
0 votes
1 answer
0 votes
1 answer

How do I set variable if a specific package version is installed in CFEngine?

Here is what you can do.Just use packagesmatching to ...READ MORE

answered Jul 12, 2018 in Other DevOps Questions by Atul
• 10,240 points
141 views
0 votes
1 answer

Making a program sleep for milliseconds?

There are no standard C API's that ...READ MORE

answered Mar 1, 2019 in Linux Administration by DareDev
• 6,850 points
67 views
0 votes
1 answer

ld unable to find existing library

your problem here is that your linker ...READ MORE

answered Mar 19, 2019 in Linux Administration by DareDev
• 6,850 points
261 views
0 votes
1 answer

How t find httpd.conf file in apache?

First f all, get apache's path: $ ps ...READ MORE

answered Feb 27, 2019 in Linux Administration by ajs3033
• 7,280 points
134 views
0 votes
1 answer

How to collect all output in one file?

You can use 2> to redirect it: foo ...READ MORE

answered Mar 1, 2019 in Linux Administration by ajs3033
• 7,280 points
71 views