[SDL] Loving SDL, but having trouble with multiple definitions of "main"

A.L.Moore lmoore67 at hotmail.com
Sat Mar 17 20:04:55 PDT 2007


I am very much enjoying using SDL in my work and am finding it to be just as 
simple as the name promises.  Except for one thing:  compile errors related 
to "main" (or "mainwin").  They've already tripped up my attempt to get SDL 
working with the Borland commandline tools (MSVC++ works fine), but this time 
I can't dodge the problem.

I need to compile a SDL-enhanced project on Linux.  I know almost nothing 
about Linux, but have gotten a development environment up and running.  Here's 
the situation:

distro:  PCLinuxOS (great for people venturing out from Windows)

compiler:  GCC, run in Konsole

addition to makefile:
SDL_CFLAGS := $(shell sdl-config --cflags)
SDL_LDFLAGS := $(shell sdl-config --libs)

error message: 
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1/../../../crt1.o: In function 
`_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status

My first guess with this error message was that I hadn't installed SDL 
correctly.  So, I uninstalled the rpms and tried again.  Here's the Konsole 
log:

[root at localhost RPMs]# rpm -ivh SDL-1.2.11-1.i386.rpm
Preparing...                ########################################### [100%]
        file /usr/lib/libSDL-1.2.so.0.11.0 from install of SDL-1.2.11-1 
conflicts with file from package libSDL1.2-1.2.11-4pclos2007

       (I hope this means that base SDL is already installed.  I'm nervous 
about un-installing "libSDL1.2-1.2.11-4pclos2007", because I suspect that 
other PCLinuxOS stuff depends on it, and I could quickly trash my OS if I 
don't ask this forum for help first.)

[root at localhost RPMs]# rpm -ivh SDL-devel-1.2.11-1.i386.rpm
Preparing...                ########################################### [100%]
   1:SDL-devel              ########################################### [100%]
[root at localhost RPMs]# rpm -ivh SDL_ttf-2.0.8-1.i386.rpm
Preparing...                ########################################### [100%]
   1:SDL_ttf                ########################################### [100%]
[root at localhost RPMs]# rpm -ivh SDL_ttf-devel-2.0.8-1.i386.rpm
Preparing...                ########################################### [100%]
   1:SDL_ttf-devel          ########################################### [100%]


Ladies and gents, what am I doing wrong?  If you need more information, please 
let me know!  :-)




More information about the SDL mailing list