| | |
undefined reference
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jan 2008
Posts: 27
Reputation:
Solved Threads: 0
Hi guys ! This has been killing me for 8 hours
Things work well I'm compiling this way :
But when I add a link to /usr/local/sesam/lib/libssv.so that i need
I get :
dont know how to fix it... it will compile on my mate's comp but not on mine
when i run on my friends's, it will print one more line than on mine : tried to link that library on mine but didn't succed. Locating it will find :
Maybe this is why my program wont compile on my computer...
I can provide more details if you need.
Hope you can help
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
•
•
•
•
g++ -Wall -o prog prog.cpp -L/usr/local/sesam/lib -lssv -Wl,-rpath /usr/local/sesam/lib -Wl,-rpath,/usr/local -ldl -lc
•
•
•
•
/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 »
when i run
•
•
•
•
ldd prog
•
•
•
•
libstdc++-libc6.1-1.so.2 => /usr/lib/libstdc++-libc6.1-1.so.2 (0xb7bf3000)
•
•
•
•
/usr/lib/libstdc++-libc6.1-1.so.2
I can provide more details if you need.
Hope you can help
Last edited by Spartan552; May 22nd, 2008 at 6:10 am.
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.
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.
Last edited by thekashyap; May 22nd, 2008 at 7:43 am.
Are you Agile.. ?
![]() |
Similar Threads
- undefined reference error -HELP! (C++)
- Dev C++ linker errors, undefined reference (C++)
- undefined reference to 'main' (C++)
- [Linker error] undefined reference to `CQTMovieFile::CQTMovieFile()' (C++)
- What is it meaned [Linker error] undefined reference to `MAPILogon@24' (C++)
- Dev-C++, GLUI linker error, undefined reference (C++)
- undefined reference errors when using C++ Sockets Library (C++)
Other Threads in the C++ Forum
- Previous Thread: Algorithim
- Next Thread: Help with program...can't get array to accept a struct
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





