Help with linking to a static library
Help with linking to a static library
- Subject: Help with linking to a static library
- From: Brant Sears <email@hidden>
- Date: Mon, 8 Mar 2004 20:12:10 -0800
Hi. I have a project that creates a static library and another that uses it.
I've been having problems getting it to work correctly and I have searched
the archives and found some helpful things, yet I'm still having issues.
My library project creates a library called libBeacons.a (thanks to the
archives I know it has to start with lib and end with .a)
I did setup the exports file. I'm trying to export a symbol
(_BeginListening) under C interface.
When I type "otool -vS libBeacons.a" at the command line, it shows the
symbol I'm trying to export: _BeginListening
I createed a project that makes a Cocoa app and uses my interface and
attempts to call BeginListening. It uses the same header I used in my
library project. I know that this is not a name mangling problem (or at
least I've dealt with C++ name mangling issues - perhaps there are Obj-C
mangling issues I don't know about). This function creates a cocoa object of
a class I wrote called Listener, spawns a thread, and then calls the object
with the thread.
The error that I'm getting is a Link Error (undefined symbols):
.objc_class_name_Listener
___gxx_personality_v0
Before I had the library named correctly, I was getting an undefined symbols
error for _BeginListening. Once I put the correct name on the library (the l
in lib has to be lowercase), that problem went away and was replaced with
the above link error.
I tried adding these names to my ExportedSymbols file this caused the library
to no longer compile. Since my Listener class depends on Cocoa and on
CoreFoundation, I tried making sure my app links to those frameworks. I also
made sure that the GCC settings are the same between the two projects. I
have it set to no optimization. Also, I am using Project Builder from the
Dec 2002 Tools.
Can anyone tell me what I'm doing wrong here? Thanks.
Brant Sears
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.