Undefined symbols insanity after upgrading to Xcode 2.1...
Undefined symbols insanity after upgrading to Xcode 2.1...
- Subject: Undefined symbols insanity after upgrading to Xcode 2.1...
- From: Dave Thorup <email@hidden>
- Date: Mon, 25 Jul 2005 16:29:07 -0400
OK, I've just upgraded all of our library projects to Xcode 2.1 and
now I'm trying to get an application that uses those libraries to
run. The problem is that now I'm running into undefined symbols and
I can't figure out why. I'm using Xcode 2.1 and building with GCC
3.3 for everything. The following symbols for three methods are
undefined:
__ZThn4_N17CStratoFilterBase12StratoNotifyEPK17IStratoDataSourcelPv
__ZThn4_N17CStratoFilterBase21StratoAddedDataSourceEPK17IStratoDataSourc
e
__ZThn4_N17CStratoFilterBase23StratoRemovedDataSourceEPK17IStratoDataSou
rce
They happen to be the last three public methods declared in the
header file for the class. There are no problems with the rest of
the methods in the class. Here is how they are declared:
virtual IStratoError * StratoAddedDataSource(
const IStratoDataSource * pSource );
virtual IStratoError * StratoRemovedDataSource(
const IStratoDataSource * pSource );
virtual IStratoError * StratoNotify(
const IStratoDataSource * pSource, long nCode, void * pData );
If I use nm to view the global symbols in the .o file then I find the
symbols there as I would expect:
000084f0 S
__ZThn4_N17CStratoFilterBase12StratoNotifyEPK17IStratoDataSourcelPv
000084d0 S
__ZThn4_N17CStratoFilterBase21StratoAddedDataSourceEPK17IStratoDataSourc
e
000084e0 S
__ZThn4_N17CStratoFilterBase23StratoRemovedDataSourceEPK17IStratoDataSou
rce
The capital "S" indicates that these symbols are exported globally.
The library that is built is a dynamic library and if I use nm to
view which symbols are exported globally (nm -g) then I find that
these symbols are nowhere to be found. If I use nm to view all of
the symbols in the library then I find the symbols:
00046550 s
__ZThn4_N17CStratoFilterBase12StratoNotifyEPK17IStratoDataSourcelPv
00046530 s
__ZThn4_N17CStratoFilterBase21StratoAddedDataSourceEPK17IStratoDataSourc
e
00046540 s
__ZThn4_N17CStratoFilterBase23StratoRemovedDataSourceEPK17IStratoDataSou
rce
Here though the "s" is lower case indicating that these symbols are
local to the library. But why are they local? Why aren't they
exported globally?
The only way to get around this problem that I've found so far is to
add the .cpp file to my application's project and compile it
explicitly. This is no solution however since I'm one of the only
people that has access to the source code of the libraries. I'm not
using an exported symbols file so everything should be exported
globally, right?
Does anyone have any ideas?
Thanks!
_____________________________
Dave Thorup
Software Engineer
email@hidden
http://www.kuwan.net
Defaults Manager - The premier editor for Mac OS X's User Defaults /
Preferences database.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden