argument order in cygwin gcc 4.3 matters when linking with glib-2.0
- by SetJmp
I am trying to compile code that works on os x and linux using cygwin. However, I am finding that the argument order to gcc gives unanticipated results.
For example, the following fails:
gcc -std=gnu99 `pkg-config --libs glib-2.0 --cflags glib-2.0` nb-learn.c
but the following works:
gcc -std=gnu99 nb-learn.c `pkg-config --libs glib-2.0 --cflags glib-2.0`
Can someone explains how this works? Also, are there techniques or code I can look at for getting autoconf to change the argument order depending on the platform?
Thanks,
SetJmp
(gcc 4.3.4)