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,550 points
6,525 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
1,970 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
122 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 20, 2019 in Linux Administration by DareDev
• 6,870 points
206 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
• 52,440 points

edited Jul 2, 2019 by Gitika 256 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
224 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,870 points
139 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,870 points
649 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
474 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
105 views