DOH!

> On 18/01/2015, at 9:52 pm, Roland King <[email protected]> wrote:
> 
> Is that code really copy and pasted, because you have a spelling error in the 
> 
> #ifdef __cplusplus 
> 
> line. You’ve switched the p and the l
> 
>> On 18 Jan 2015, at 16:46, tridiak <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> I have problem with a C++ file finding a symbol in a dynamic library.
>> 
>> ==============================
>> // library header file
>> #ifdef __clpusplus
>> extern "C" {
>> #endif
>> extern SOArrayRef SOGetAllSpells();
>> #ifdef __clpusplus
>> }
>> #endif
>> 
>> ===============================
>> // Test.m file
>> 
>> void Test1() {
>> SOArrayRef ary=SOGetAllSpells();
>> }
>> ================================
>> // TestFile.cpp file
>> 
>> void SATest() {
>> SOArrayRef ary=SOGetAllSpells();
>> }
>> ===============================
>> 
>> When I attempt to compile, the compiler spews out 
>> Undefined symbols for architecture x86_64:
>>   "SOGetAllSpells()", referenced from:
>>       _SATest in TestFile.o
>> ld: symbol(s) not found for architecture x86_64
>> 
>> The error only occurs in the C++ file, not the .m (or C) file.
>> The symbol exists otherwise it would complain ‘_Test1 in Test.o' also.
>> If I remove the symbol reference from the C++ file, it compiles without any 
>> issue.
>> The library symbol exists, nm verified it for me.
>> 
>> OS 10.10.1, XCode 5.1.1 & 6.1
>> 
>> Any idea why this is happening?
>> 
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to