argument order in cygwin gcc 4.3 matters when linking with glib-2.0

Posted by SetJmp on Stack Overflow See other posts from Stack Overflow or by SetJmp
Published on 2010-04-13T19:18:15Z Indexed on 2010/04/13 19:23 UTC
Read the original article Hit count: 349

Filed under:
|
|
|
|

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)

© Stack Overflow or respective owner

Related posts about gcc

Related posts about autoconf