Many Thanks for your replies!
But there?s still a problem:
make
gcc -o grw_test sdl-config --cflags
sdl-config --libs
/usr/lib/crt1.o: In function _start': /usr/lib/crt1.o(.text+0x18): undefined reference to
main’
collect2: ld returned 1 exit status
make: *** [grw_test] Error 1
I don?t understand this, because the command
gcc -o test grw_main.o $(bash sdl-config --libs) $(bash sdl-config
–cflags)
compiles correct.
Luc MAZARDO wrote:>
Sven Garbade <@Sven_Garbade> writes:
[…]
What is wrong with the Makefile?
TARGET = grw_test
OBJECTS = grw_main.o
from the SDL-FAQ
SDL_LDFLAGS := $(bash sdl-config --libs)
SDL_CFLAGS := $(bash sdl-config --cflags)
$(TARGET): $(OBJECTS); gcc -o $(TARGET) $(OBJECTS) $(SDL_LDFLAGS)
$(SDL_CFLAGS)
grw_main.o: grw_main.c; gcc -c grw_main.c
with sdl-config --libs
and sdl-config --cflags
, it’s seems to
works !
–
Luc Mazardo
http://OCamlSdl.sourceforge.net
Gnu Emacs:flame.el Don’t you realise that it’s a wonderful day?
Sven Garbade schrieb am 27 Jun 2000:
Many Thanks for your replies!
But there?s still a problem:
make
gcc -o grw_test sdl-config --cflags
sdl-config --libs
/usr/lib/crt1.o: In function _start': /usr/lib/crt1.o(.text+0x18): undefined reference to
main’
collect2: ld returned 1 exit status
make: *** [grw_test] Error 1
What happened here? Did the $(OBJECTS) get lost?
You need the .o file too, like:
gcc -o test gwr_main.o sdl-config --cflags
sdl-config --libs
–
Check out my 3D lightcycle game: http://www.gltron.org
More than 60’000 Downloads of the latest version (0.59)