Re: g++ and linker issue
- From: Paul Pluzhnikov <ppluzhnikov-nsp@xxxxxxxxx>
- Date: Wed, 19 Dec 2007 20:38:06 -0800
conrad <conrad@xxxxxxxxxx> writes:
My directory /home/foo/bunk contains a shared object(gb.so) and
a C++ source file.
I invoke g++:
g++ -L/home/foo/bunk -o driver driver.cc -lgb
/usr/bin/ld: cannot find -lgb
collect2: ld returned 1 exit status
What am I missing here?
Given above link line, the linker will search /home/foo/bunk and
standard library directories for libgb.so and libgb.a
Since no such file exists, you get the error.
You can name your library correctly:
mv gb.so libgb.so
or create a symlink for it:
ln -s gb.so libgb.so
You may also wish to add '-Wl,-rpath=/home/foo/bunk' to your link
line, so that runtime loader could find your library as well.
Or you could just link the library directly:
g++ -o driver driver.cc /home/foo/bunk/gb.so
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
.
- References:
- g++ and linker issue
- From: conrad
- g++ and linker issue
- Prev by Date: Re: g++ and linker issue
- Next by Date: Re: ping fails for link local address( IPv6)
- Previous by thread: Re: g++ and linker issue
- Index(es):
Relevant Pages
|