linker error

Linux specific forum
User avatar
idle
Always Here
Always Here
Posts: 6026
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

linker error

Post 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
Windows 11, Manjaro, Raspberry Pi OS
Image
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: linker error

Post by Fred »

Seems like you need to link with stdc++ lib
User avatar
idle
Always Here
Always Here
Posts: 6026
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: linker error

Post 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.
Windows 11, Manjaro, Raspberry Pi OS
Image
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: linker error

Post 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
quidquid Latine dictum sit altum videtur
User avatar
idle
Always Here
Always Here
Posts: 6026
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: linker error

Post 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
Windows 11, Manjaro, Raspberry Pi OS
Image
Post Reply