Re: What should be a simple linking problem
Re: What should be a simple linking problem
- Subject: Re: What should be a simple linking problem
- From: Tommy Nordgren <email@hidden>
- Date: Thu, 9 Apr 2009 21:58:26 +0200
On Apr 9, 2009, at 9:45 PM, Richard L. Aurbach wrote:
I'm having a problem with an undefined symbol during linking which
has me perplexed.
My application uses an external C-language library (built as a
static library with a .a extension [ libSCCE.a ]). The library calls
an external function SCCE_TempLexName(char*) which it expects the
host application to provide.
My (host) application implements this function as follows:
in SSCE_TempLexName.h :
#if defined(__cplusplus)
extern "C" {
#endif
void SSCE_TempLexName (
char * outPath );
#if defined(__cplusplus)
}
#endif
Make sure you include SSCE_TempLexName.h
Otherwise SSCE_TempLexName gets mangled, so your library can't find it
during linking
in SSCE_TempLexName.cpp:
void
SSCE_TempLexName (
char * outPath )
{
... C++ body - the content doesn't matter here
}
The implementation is explicitly (and needs to be) a C++ function
because it uses C++ class objects in its implementation.
MY PROBLEM:
The linker has an undefined symbol error:
"SSCE_TempLexName(char*)", referenced from:
getTempFileName() in libSCCE.a(DFTLEX.o)
saveLexFile(DFTLEX*) in libSCCE.a(DFTLEX.o)
This worked in my CodeWarrior projects, but it obviously doesn't
here. Can someone point out what I am doing wrong??
Cheers,
Rick Aurbach
_______________________________________________
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
------
What is a woman that you forsake her, and the hearth fire and the home
acre,
to go with the old grey Widow Maker. --Kipling, harp song of the Dane
women
Tommy Nordgren
email@hidden
_______________________________________________
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