chiArtem / unitt

Automatically exported from code.google.com/p/unitt
0 stars 0 forks source link

Linker error: duplicate symbol _WebSocketException #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add static library to iOS project
2. configure lib search paths as suggested
3. build for iPhone Simulator

What is the expected output? What do you see instead?
ld: duplicate symbol _WebSocketException in 
/Users/bgulanowski/Dev/Nulayer/crowdstream/dependencies/UnittWebSocketClient/bin
/Debug-iphonesimulator/libUnittWebSocketClient.a(WebSocket07.o) and 
/Users/bgulanowski/Dev/Nulayer/crowdstream/dependencies/UnittWebSocketClient/bin
/Debug-iphonesimulator/libUnittWebSocketClient.a(WebSocket00.o) for 
architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang 
failed with exit code 1

What version of the product are you using? On what operating system?
version 2.1 on iOS 5.0

Please provide any additional information below.
I'd really like an explanation of how you are putting two different classes 
with the same name into the same library. Not to mention the other associated 
symbols with the same names. This doesn't seem right. How can the linker 
distinguish them? Apparently in can't, in this case.

For the short term, I'm going to build the library myself and NOT include the 
webSocket00.h/m files.

Original issue reported on code.google.com by bgulanow...@gmail.com on 27 Jun 2011 at 9:03

GoogleCodeExporter commented 9 years ago
I will change the symbols. I was trying to enable a smoother management of the 
various specs under one type, but I think it causes more trouble than it helps. 
I will change the interface/class to match the files to keep things more clear. 
Look for a new version tonight. Thank you for filing a ticket.

Original comment by joshuadmorris@gmail.com on 28 Jun 2011 at 2:22

GoogleCodeExporter commented 9 years ago
Please try the new v2.2 build. It should address your issue.

Original comment by joshuadmorris@gmail.com on 28 Jun 2011 at 2:54

GoogleCodeExporter commented 9 years ago
I get a different issue now.

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_WebSocket07", referenced from:
      objc-class-ref in CrowdStreamClient.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang 
failed with exit code 1

and

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_WebSocket07", referenced from:
      objc-class-ref in CrowdStreamClient.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed 
with exit code 1

Original comment by bgulanow...@gmail.com on 28 Jun 2011 at 1:54

GoogleCodeExporter commented 9 years ago
I have attached a project using the library to send a message on view load and 
show it in a label. Does this work for you?

Original comment by joshuadmorris@gmail.com on 28 Jun 2011 at 3:50

Attachments:

GoogleCodeExporter commented 9 years ago

I had to fix the library and header search files to point to the my downloaded 
copy of the 2.2 distribution. Do you have additional copies of the library in 
other places on your system that are being found first?

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_WebSocket07", referenced from:
      objc-class-ref in TestWsAppViewController.o
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 
failed with exit code 1

Original comment by bgulanow...@gmail.com on 28 Jun 2011 at 4:18

GoogleCodeExporter commented 9 years ago
I have verified that my environment only points to that one library on my 
system. Do you see the libUnittWebSocketClient.a file in your project? Are you 
able to select "Show in Finder" on it? Does it resolve correctly to the right 
build platform and environment?

Original comment by joshuadmorris@gmail.com on 29 Jun 2011 at 2:39

GoogleCodeExporter commented 9 years ago
If the file location wasn't resolving correctly, it wouldn't be able to link to 
the older builds or the build I made myself, either. Anyway it's fine, I'll 
just use the build I made myself with the old version of the class removed. 
Thanks.

Original comment by bgulanow...@gmail.com on 30 Jun 2011 at 12:53

GoogleCodeExporter commented 9 years ago

Original comment by joshuadmorris@gmail.com on 1 Jul 2011 at 4:35