Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » error: duplicate symbol: std::__throw_bad_alloc()
error: duplicate symbol: std::__throw_bad_alloc() [message #54624] Sat, 22 August 2020 18:19 Go to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
When using the Bazaar/plugin/assimp package, I got an error at linking (only when using CLANG) (MSVS work perfect) :
 (): Linking has failed
 (): lld-link: error: duplicate symbol: std::__throw_bad_alloc()
 (): >>> defined at Core.a(heap.o)
 (): >>> defined at libc++.a(new.cpp.obj)
 (): 
 (): lld-link: error: duplicate symbol: operator new(unsigned long long)
 (): >>> defined at Core.a(heap.o)
 (): >>> defined at libc++.a(new.cpp.obj)
  ...


The only way I have found to get around this issu is to put the flag "USEMALLOC" but I don't think it's a good way.
I don't know if this"problem" is related to Upp or assimp.

Someone can help me by explaining what's happening ?

Thanks
Re: error: duplicate symbol: std::__throw_bad_alloc() [message #54638 is a reply to message #54624] Mon, 24 August 2020 10:49 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3404
Registered: August 2008
Senior Veteran
Sorry Xemuth

I've tried my best, unsuccessfully, trying to remove this duplicate symbol error.


Best regards
Iñaki
Re: error: duplicate symbol: std::__throw_bad_alloc() [message #54639 is a reply to message #54638] Mon, 24 August 2020 11:00 Go to previous messageGo to next message
mirek is currently online  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
I believe it can still be related to:

https://github.com/mstorsjo/llvm-mingw/issues/91
Re: error: duplicate symbol: std::__throw_bad_alloc() [message #54641 is a reply to message #54639] Mon, 24 August 2020 12:03 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3404
Registered: August 2008
Senior Veteran
mirek wrote on Mon, 24 August 2020 11:00
I believe it can still be related to:

https://github.com/mstorsjo/llvm-mingw/issues/91

Yes sure.
However I am clueless. Even commenting all new/delete overloading in plugin/assimp, and rebuilding all, the error remains...


Best regards
Iñaki
Re: error: duplicate symbol: std::__throw_bad_alloc() [message #54642 is a reply to message #54624] Mon, 24 August 2020 16:44 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
What's the impact of flag "USEMALLOC" is using malloc instead of new/delete in U++ slower ?!
Re: error: duplicate symbol: std::__throw_bad_alloc() [message #54643 is a reply to message #54642] Mon, 24 August 2020 16:58 Go to previous messageGo to next message
mirek is currently online  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
Xemuth wrote on Mon, 24 August 2020 16:44
What's the impact of flag "USEMALLOC" is using malloc instead of new/delete in U++ slower ?!


I hope so Smile

Mirek
Re: error: duplicate symbol: std::__throw_bad_alloc() [message #54644 is a reply to message #54643] Mon, 24 August 2020 18:17 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
I mean do using malloc/free instead of new/delete is slower ? If no then this error is not a priority ^^
Re: error: duplicate symbol: std::__throw_bad_alloc() [message #54645 is a reply to message #54644] Mon, 24 August 2020 22:14 Go to previous messageGo to next message
mirek is currently online  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
Xemuth wrote on Mon, 24 August 2020 18:17
I mean do using malloc/free instead of new/delete is slower ? If no then this error is not a priority ^^


I mean, yes, it should. I have spent a lot of time optimizing our own allocator...
Re: error: duplicate symbol: std::__throw_bad_alloc() [message #54646 is a reply to message #54645] Tue, 25 August 2020 07:29 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3404
Registered: August 2008
Senior Veteran
The ASSIMP case is a good example of U++ efficiency (thanks to Mirek Smile ).
The same ASSIMP example compiled with MSC without USEMALLOC is much faster than with USEMALLOC.
Now it would be great to get CLANG working without USEMALLOC.


Best regards
Iñaki

[Updated on: Tue, 25 August 2020 07:31]

Report message to a moderator

Re: error: duplicate symbol: std::__throw_bad_alloc() [message #54647 is a reply to message #54646] Tue, 25 August 2020 09:40 Go to previous messageGo to next message
mirek is currently online  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
koldo wrote on Tue, 25 August 2020 07:29
The ASSIMP case is a good example of U++ efficiency (thanks to Mirek Smile ).
The same ASSIMP example compiled with MSC without USEMALLOC is much faster than with USEMALLOC.
Now it would be great to get CLANG working without USEMALLOC.


Just for the info: I have looked into it, removed all funny new/delete related code in ASSIMP, but it still does not work.
Re: error: duplicate symbol: std::__throw_bad_alloc() [message #54648 is a reply to message #54647] Tue, 25 August 2020 09:42 Go to previous message
koldo is currently offline  koldo
Messages: 3404
Registered: August 2008
Senior Veteran
mirek wrote on Tue, 25 August 2020 09:40
koldo wrote on Tue, 25 August 2020 07:29
The ASSIMP case is a good example of U++ efficiency (thanks to Mirek Smile ).
The same ASSIMP example compiled with MSC without USEMALLOC is much faster than with USEMALLOC.
Now it would be great to get CLANG working without USEMALLOC.


Just for the info: I have looked into it, removed all funny new/delete related code in ASSIMP, but it still does not work.

Yes, I did that and obtained the same result Sad


Best regards
Iñaki
Previous Topic: Building applications
Next Topic: Custom build configuration per package
Goto Forum:
  


Current Time: Sat Dec 14 14:45:08 CET 2024

Total time taken to generate the page: 0.03961 seconds