Linker Problem Help Required

Tim Prince timothyprince@sbcglobal.net
Fri Aug 18 14:25:00 GMT 2006


Manish Baphna wrote:
> Hi , 
> 
> I am Manish, a SW engr from INDIA .
> I found some threads about linking error on
> gcc.gnu.org while searching for some trouble I am
> facing . I couldn't  see the exact solution so thought
> of mailing to this maillist. I would appreciate if you
> can spare some time in replying to me.
> I am trying to build a DLL using
> 
> bash>> g++ -g -shared -o Me.dll <Various ".o"s/ ".a"s>
> 
> But when use that DLL , my program crashes because
> some symbols are not resoved. 
> bash> ld Me.dll
> ld: warning: cannot find entry symbol _start; not
> setting start address
> Me.dll: undefined reference to `__pure_virtual'
> Me.dll: undefined reference to `endl(ostream &)'
> Me.dll: undefined reference to `__rtti_user'
> Me.dll: undefined reference to
> `ostream::operator<<(ostream &(*)(ostream &))'
> Me.dll: undefined reference to `__rtti_si'
> Me.dll: undefined reference to `__rethrow'
> Me.dll: undefined reference to
> `ostream::operator<<(char const *)'
> Me.dll: undefined reference to `terminate(void)'
> Me.dll: undefined reference to
> `ostream::operator<<(int)'
> Me.dll: undefined reference to `__builtin_delete'
> Me.dll: undefined reference to `__builtin_new'
> Me.dll: undefined reference to `cout'
> 
> These things started popping up when I moved to
> gcc323. Initially I was using gcc2.95 and everything
> was fine. I have already built all dependent
> archive/object files using gcc3.2.3.
> 

Check that you are picking up the shared libraries at run time which 
correspond with the gcc version you compiled with.  There is no 
compatibility between shared libraries of different major gcc versions, 
even though they may have the same name.  If you have more than one 
version installed, you would need to make certain that the correct one 
comes first on the library search path.  gcc has its own search path for 
compiling, but that path would not be "remembered" at run time.



More information about the Gcc-help mailing list