Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Linking two static libraries that have the same symbols

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 staticVoid2   Members   

377
Like
0Likes
Like

Posted 03 October 2013 - 06:39 AM

I need to be able to use functionality from two static libraries which have been built under different build configurations. This is for backwards compatibility reasons. The problem is, during the linking process the library symbols conflict and the linker will just choose one over the other at random.

 

Is there anyway to get around this issue?

 

Thanks.



#2 Bregma   Members   

9094
Like
9Likes
Like

Posted 03 October 2013 - 08:21 AM

*
POPULAR

Short answer: no.

 

Longer answer: yes, if you're on a platform supporting weak symbols and one of the libraries has marked the symbol as weak and the other hasn't.

 

Final answer:  this is an old, old problem.  The language-level workaround is to properly namespace symbols.  The linker-level workaround is either weak symbols or linker maps or both.  The simple solution is to have access to the source and fix it.


Stephen M. Webb
Professional Free Software Developer

#3 achild   Members   

2194
Like
0Likes
Like

Posted 03 October 2013 - 08:56 AM

Yeah... there aren't a lot of options there. Do they have to be statically linked?



#4 swiftcoder   Senior Moderators   

18215
Like
3Likes
Like

Posted 03 October 2013 - 11:19 AM

Last ditch hack, if Bregma's suggestions are not usable: statically link one of the libraries to a dynamically linked wrapper library which aliases the offending symbols.


Tristam MacDonald - Software Engineer @ Amazon - [swiftcoding] [GitHub]





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.