Undefined symbols for architecture x86_64 on Xcode 6.3

Hi,


My name is Mikael and for the past few month now i was working on an Open source CometD C coded library. To finalize my work i thought it will be a good idea to propose a Wrapped version of the library to Ios and Osx users.


Sadly for some reasons i'am not able to decipher, i'am stuck with the compilation of the C code into the Static Ios library.


Here is my post on StackOverflow, were all the details are :


http://stackoverflow.com/questions/31808981/undefined-symbols-for-architecture-x86-64-on-xcode-6-3


In the hope of finding answers, thank you very much for any help.


Kind Regards Mikael.

I think you're misinterpreting the output of

nm
. Consider this code:
extern void Foo(void);
extern void Bar(void);

extern void Foo(void) {
    Bar();
}

It has a function

Foo
that references another function
Bar
. If you put it in a static library and then dump the symbol table you get this:
$ nm libxxx.a

libxxx.a(xxx.o):
…
                 U _Bar
0000000000000000 T _Foo
…

Note that

Foo
is flagged with T, indicating that it's a code ( T stands for text) symbol that's exported. OTOH,
Bar
is flagged with U, which stands for Undefined, indicating that it's a symbol used by this library but not defined in it.

Looking at your

nm
dump it seems that all the functions you're expecting to export are flagged with U.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Well i took a quick view at your project mentioned:

https://github.com/GhostGumm/CometD-x86_64-issue


Where are multiple linker error, for example the symbol "init_add_me_data" not found.

when i downloaded your source and performed grep in the folder I've got the following:

$ grep -r init_add_me_data .
./OsxIosFramework/comet_message.c:  message->data = init_add_me_data(groupe, owner, NULL);
./OsxIosFramework/comet_message.c:  message->data = init_add_me_data(group, owner, NULL);
./OsxIosFramework/comet_message.c:  message->data = init_add_me_data(group, owner, user);
./OsxIosFramework/comet_message.h:  json_t        *init_add_me_data(char *group, const char *owner, const char *user);


Where is no any implementation of this function, only the prototype declared in the header file and three calls from the ".c" file.

You probably need to add either source files for missing functions or static libraries with compiled code for missing functions.

Where are multiple linker error, for example the symbol "init_add_me_data" not found.

when i downloaded your source and performed grep in the folder I've got the following

$ grep -r init_add_me_data . 
./OsxIosFramework/comet_message.c:  message->data = init_add_me_data(groupe, owner, NULL); 
./OsxIosFramework/comet_message.c:  message->data = init_add_me_data(group, owner, NULL); 
./OsxIosFramework/comet_message.c:  message->data = init_add_me_data(group, owner, user); 
./OsxIosFramework/comet_message.h:  json_t        *init_add_me_data(char *group, const char *owner, const char *user);

Where is no any implementation of this function, only the prototype declared in the header file and three calls from the ".c" file.

You probably need to add either source files for missing functions or static libraries with compiled code for missing functions

Undefined symbols for architecture x86_64 on Xcode 6.3
 
 
Q