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,980 points
11,965 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,300 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 20, 2019 in Linux Administration by Rishi
7,705 views
0 votes
1 answer

How can I find out which files differ in two directory trees?

Use this; diff -qr dir1/ dir2/ READ MORE

answered Jun 13, 2019 in Linux Administration by Upasana
• 8,620 points
547 views
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 21, 2019 in Linux Administration by DareDev
• 6,890 points
753 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
• 65,910 points

edited Jul 2, 2019 by Gitika 2,043 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
943 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,890 points
1,018 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,890 points
3,365 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,300 points
2,314 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,300 points
756 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP