Page 1 of 1

linker error

Posted: Sun May 29, 2011 11:08 pm
by idle
I'm getting this linker error and not really sure why
do I need to export an environment path or something so the linker knows where else to look?
Error: Linker
/usr/lib/llvm-2.8/lib/libLLVMCore.a(Core.o): In function `LLVMCreateBuilderInContext':
(.text+0x1167): undefined reference to `operator new(unsigned int)'
It's works fine with the .so but then that's in /usr/lib

Re: linker error

Posted: Tue May 31, 2011 10:32 am
by Fred
Seems like you need to link with stdc++ lib

Re: linker error

Posted: Tue May 31, 2011 11:02 am
by idle
Thanks, I'm not sure how I would go about doing that?
The linker error is coming from the static libs not finding their dependencies
so all I could think of was that I needed to set an Environment Path in .profile (or where ever else you set them in ubuntu)
so it can find the C++ libs
Anyway the .so doesn't complain yet (but it's bound to once I feed it my code) so I'll go with that until it's ready to go static.

Re: linker error

Posted: Tue May 31, 2011 5:01 pm
by freak
idle wrote:Thanks, I'm not sure how I would go about doing that?
Add this to your code:

Code: Select all

ImportC "-lstdc++"
EndImport

Re: linker error

Posted: Tue May 31, 2011 9:29 pm
by idle
Thanks, now that's just to easy.
It didn't work though still got the same errors, guess I'll figure it out eventually