You are not logged in.

#1 2009-07-14 17:49:06

scragar
Member
Registered: 2009-07-14
Posts: 108

[SOLVED] Can't compile using SDL

I wrote this simple test.

#include <SDL.h>
int main( int argc, char **argv ) {
  return 0;
}

And when compiling it with

gcc -g -Wall -I/usr/include/SDL -o sdl-test.c -lSDL

I get:

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../lib/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status

Anyone have any idea what I've done wrong or am missing?

Last edited by scragar (2009-07-14 18:43:29)

Offline

#2 2009-07-14 18:33:48

e_tank
Member
Registered: 2006-12-21
Posts: 80

Re: [SOLVED] Can't compile using SDL

you forgot to specify the output name, i missed it too upon first glance

gcc -g -Wall -I/usr/include/SDL -o sdl-test sdl-test.c -lSDL

Offline

#3 2009-07-14 18:37:12

scragar
Member
Registered: 2009-07-14
Posts: 108

Re: [SOLVED] Can't compile using SDL

Well, I feel stupid now.

Thanks so much for that, from the error I was thinking I'd screwed up a library or something, would never have tried changing the line I used to compile it.

Offline

Board footer

Powered by FluxBB