Hi guys ! This has been killing me for 8 hours

Things work well I'm compiling this way :

g++ -Wall -o prog prog.cpp -L/usr/local/sesam/lib -Wl,-rpath /usr/local/sesam/lib -Wl,-rpath,/usr/sesam/lib -ldl -lc

But when I add a link to /usr/local/sesam/lib/libssv.so that i need

g++ -Wall -o prog prog.cpp -L/usr/local/sesam/lib -lssv -Wl,-rpath /usr/local/sesam/lib -Wl,-rpath,/usr/local -ldl -lc

I get :

/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « ios virtual table»/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « ws(istream &) »
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « __rtti_user »
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « istream::ios virtual table»
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « __throw »
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « terminate(void)»
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « istream::get(char *, int, char)»
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « istream::getline(char *, int, char)»
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « istrstream::istrstream(int, char const *, int)»
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « istrstream::~istrstream(void)»
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « istream::ignore(int, int)»
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « ifstream::~ifstream(void)»
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « istream::peek(void)»
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « __builtin_vec_new »
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « __builtin_vec_delete »
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « fstreambase::fstreambase(int, char const *, int, int)»
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « ifstream::ios virtual table»
/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « __builtin_delete »/usr/local/sesam/lib/libsgd.so: référence indéfinie vers « __builtin_new »

dont know how to fix it... it will compile on my mate's comp but not on mine

when i run

ldd prog

on my friends's, it will print one more line than on mine :

libstdc++-libc6.1-1.so.2 => /usr/lib/libstdc++-libc6.1-1.so.2 (0xb7bf3000)

tried to link that library on mine but didn't succed. Locating it will find :

/usr/lib/libstdc++-libc6.1-1.so.2

Maybe this is why my program wont compile on my computer...

I can provide more details if you need.

Hope you can help

1. I wonder why things work without linking to /usr/local/sesam/lib/libssv.so if you need it.
And if links without it I wonder why you need it.
2. Compare the size/timestamp of your mate's lib and your lib (/usr/lib/libstdc++-libc6.1-1.so.2). I think comparing the symbol table would be an overkill if size/timestamp are same.
3. Can't really say much except that when you link with ssv, the symbols needed by it are not available so it gives errors ! But I think it's pretty obvious.. :)

It does seem like the symbols you need might be there in stdc++. But you can confirm it once. So what you can do is:
- "ldd prog" on mate's comp
- then look for one of the symbols say "terminate(void)" in all .so files listed there. (donno what's teh command to list all symbols in a .so in gnu. In Sun workshop it's nm -C, so it goes like this: nm -C <xxx.so>| grep "terminate")
- Then find the same .so on your machine and check that it also contains the symbols, if it does link with it, if it doesn't it's a problem with your installation/version..

Lastly, check the documentation of your STL impl. Usually if you link to .so(s) specified there things should work.

fixed this installing a newer version of the library libstdc++

Download : libstdc++-2-libc6.1-1-2.9.0.so in /usr/lib then type :

ln -s libstdc++-2-libc6.1-1-2.9.0.so libstdc++-libc6.1-1.so.2
ldconfig

Thanks for ur help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.