I've been trying to use GLib in a project. I work with XCode. I downloaded Glib via Homebrew:
brew install glib
I then run
brew test glib
Which outputs
/usr/bin/clang -o test test.c -I/usr/local/Cellar/glib/2.36.3/include/glib-2.0 -I/usr/local/Cellar/glib/2.36.3/lib/glib-2.0/include -I/usr/local/opt/gettext/include -L/usr/local/Cellar/glib/2.36.3/lib -L/usr/local/opt/gettext/lib -lglib-2.0 -lintl -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.9 -isysroot /Applications/Xcode5-DP6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
So, I copied all the -I arguments, and pasted them into XCode -> Project Settings -> Build Settings -> Other C Flags.
In a .c file inside my XCode project I have
GList *processList_p = NULL; /* Pointer to the process list */
If I compile everything works, but then if I call a function from GLib, such as
//Create the new list element, append it to the list and return the pointer.
return g_list_append(processList, newProcess);
I get the error
Undefined symbols for architecture x86_64: "_g_list_append", referenced from: _CreateProcess in Scheduler.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I really have no idea what's going on, any help would be greatly appreciated.