undefined symbol, compiler version? shared library troubles?
Hi,
I am trying to create a shared library. The library seems to compile and link fine, but at runtime I get an undefined symbol error. I am trying to link in a static library whose symbol is not found. I tried recompiling the static library with the '-fPIC' option with no luck. Is linking in a static library to a shared library my problem? The static library is compiled with a different version of g++ than the rest of the library. Can this be the cause of the problem? What problems can be anticipated when linking in library that was compiled with a different compiler version? A heap of thanks. |
Are adding the static lib to your LDFLAGS?
|
I am using the CMake system, and did the equivalent.
I recompiled everything with the same version of gcc (3.4.4), but still problems. |
What does ldd (ldd yourprogram) show? Do you know where does the undefined symbol come from (the static library or some other location)?
|
Quote:
Thanks |
When a library is linked statically to your program, its' dependencies are counted as program's dependencies. The thing that may go wrong here is search for the Matlab libraries. Hard to say without knowing the symbol there's problem with. What's the name of it and do you have an idea where it should be found (the static library?)
|
Thanks for the help Mara. The library I was trying to link in was ccpl http://sourceforge.net/projects/ccpl/ , which I had compiled myself. I found some thread, (which I can't seem to find anymore :P !), that suggested wrapping the link option in two -Wl,option commands, though I don't remember what the option was. It seemed to fix the undefined symbol for ccpl, but I was then getting undefined symbol errors for the pgplot library! I have moved on to a different solution for the libraries I will use...
|
All times are GMT -5. The time now is 10:40 AM. |