Have a simple C program using glib library for referencing and dereferencing GObject. I wrote the code on ubuntu and have installed glib library on it.
Running the command
gcc *.c `pkg-config --cflags --libs glib-2.0` -o test
works fine.
Now I tried the same on MacOs. I installed the gcc, glib and tried the above command. But I am getting the following error:
Undefined symbols for architecture x86_64:
"_g_obejct_new", referenced from:
_my_obejct_new in program-4735d1.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Now I have tried different things like building the glib library as mentioned here
But still gave the same error.
Also important thing to note is that the ubuntu also have the architeture x86_64 which I found out by running the command uname-m