gossip icon indicating copy to clipboard operation
gossip copied to clipboard

Duplicate Symbols

Open troya2 opened this issue 11 years ago • 3 comments

I followed the read me, including building a fat binary. I included the project into my workspace and added libc++.dylib to my project to get everything to compile. However, I'm getting 56 duplicate symbols in libGossip.o when linking. One from error.o, about half in sdp.o, and the rest in sdp_cmp.o.

duplicate symbol _pjmedia_strerror in error.o duplicate symbol _pjmedia_sdp_attr_create in sdp.o duplicate symbol _pjmedia_sdp_attr_clone in sdp.o duplicate symbol _pjmedia_sdp_attr_find in sdp.o ... duplicate symbol _pjmedia_sdp_media_cmp in sdp_cmp.o duplicate symbol _pjmedia_sdp_session_cmp in sdp_cmp.o duplicate symbol _pjmedia_sdp_conn_cmp in sdp_cmp.o ...

Any idea what I need to do to eliminate the duplicate symbols?

Thanks!

troya2 avatar Aug 19 '14 06:08 troya2

Hmmm, how does your build settings looks like? Are you by any chance linking PJSIP twice? I think there might be some duplicate libs being linked somewhere (from Gossip or otherwise.) I'll give a full fresh build this weekend and see if there's anything to be updated but that's my initial thoughts.

Also, feel free to PR if you find anything broken or incorrect. : )

chakrit avatar Aug 19 '14 13:08 chakrit

I think it was my mistake - I added libGossip.a to my link build phase. I didn't realize that Xcode would link to it automatically because it is part of the workspace.

troya2 avatar Aug 19 '14 17:08 troya2

On further investigation, it appears that libGossip.a does need to be in the link build phase, and that results in the duplicate symbols. I ran ar on libGossip.a and see that there are a number of .o files duplicated - is this normal, or could it be the source of the problem? The duplicated .o files are:

% ar xv libGossip.a | sort | uniq -d x - endpoint.o x - errno.o x - json.o x - lpc.o x - preprocess.o x - presence.o x - sdp.o x - sdp_cmp.o x - sdp_neg.o x - sha1.o x - string.o x - types.o

troya2 avatar Aug 19 '14 23:08 troya2