Results 1 to 2 of 2
I'm trying to use Autotools to build my C program that needs to be linked against certain libraries. It only contains one C source file.
This is the Makefile.am associated ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-21-2010 #1Just Joined!
- Join Date
- Nov 2010
- Posts
- 1
[Autotools] Linker flags in wrong place
I'm trying to use Autotools to build my C program that needs to be linked against certain libraries. It only contains one C source file.
This is the Makefile.am associated with it:
When I run make, it tries to compile it using this:Code:bin_PROGRAMS=game game_SOURCES=main.c game_CFLAGS=`pkg-config --cflags libglfw` game_LDFLAGS=`pkg-config --libs libglfw`
However this is wrong, as the library link flags must be at the end, or else it will give errors about undefined references. For example if I run this:Code:gcc `pkg-config --cflags libglfw` -g -O2 `pkg-config --libs libglfw` -o game game-main.o
It compiles fine.Code:gcc `pkg-config --cflags libglfw` -g -O2 -o game game-main.o `pkg-config --libs libglfw`
How can I make it so the LDFLAGS primary is appended at the end rather than in the middle?
- 02-15-2011 #2Just Joined!
- Join Date
- Feb 2011
- Posts
- 8
Hello,
I have the same problem here.
Have you found your answer?
I ll appreciate if you share it with us =)
Thx a lot!


Reply With Quote
