What is WinMain@16 ? I can't link!

When I try to compile :
gcc -o testwin.exe testwin.c -lSDL -lSDLmain

I get :
\egcs-mingw32\i386-pc-mingw32\lib\libmingw32.a(main.o)(.text+0x7d):
undefined reference to `WinMain at 16’

But if I compile a simple “hello world”, it link fine.
Any Ideas ?

Vivien

Try to cross compile some of the demos that use “configure” and you’ll
see what you need to do, you are missing all of the required windows
libraries… like -lkernel32 -lgdi32, etc.–
Brian

On Mon, 17 Jan 2000, Vivien TURMEL wrote:

When I try to compile :
gcc -o testwin.exe testwin.c -lSDL -lSDLmain

I get :
\egcs-mingw32\i386-pc-mingw32\lib\libmingw32.a(main.o)(.text+0x7d):
undefined reference to `WinMain at 16’

But if I compile a simple “hello world”, it link fine.
Any Ideas ?

Vivien

When I try to compile :
gcc -o testwin.exe testwin.c -lSDL -lSDLmain

I get :
\egcs-mingw32\i386-pc-mingw32\lib\libmingw32.a(main.o)(.text+0x7d):
undefined reference to `WinMain at 16’

But if I compile a simple “hello world”, it link fine.
Any Ideas ?

Sounds like you haven’t run configure properly. To install SDL correctly, you
want to basically do this:

cd /usr/local/src
tar zxvf SDL-whatever.tar
cd SDL-whatever
ls
(if it’s a CVS version)./autogen.sh
(else)configure
make
make install
cd test
ls
./configure (I don’t remember if this one is also an autogen.sh for CVS)
make

there you go, that should do it. It sounds like you’re not configuring your
files properly. God, I hate autoconf.

Nicholas

That’s exactly that. I read everywhere to “configure”, but I run Win95, not
Linux, and configure is a Linux shell.
I don’t have /usr/local, ls etc but I do have make and tar.

I thought that programs written in SDL could be compiled either under Linux,
either under Win95. Isn’t that right ?

I have plenty of *.a in my lib directory, but if I “grep” WinMain, I only
get crt1.o,crt2.o,libSDLmain.a and libmingw32.a

Does Everybody here use Linux here ?

Vivien

----- Message d’origine -----De :
? :
Envoy? : lundi 17 janvier 2000 19:17
Objet : Re: [SDL] What is WinMain at 16 ? I can’t link !

When I try to compile :
gcc -o testwin.exe testwin.c -lSDL -lSDLmain

I get :
\egcs-mingw32\i386-pc-mingw32\lib\libmingw32.a(main.o)(.text+0x7d):
undefined reference to `WinMain at 16’

But if I compile a simple “hello world”, it link fine.
Any Ideas ?

Sounds like you haven’t run configure properly. To install SDL correctly,
you
want to basically do this:

cd /usr/local/src
tar zxvf SDL-whatever.tar
cd SDL-whatever
ls
(if it’s a CVS version)./autogen.sh
(else)configure
make
make install
cd test
ls
./configure (I don’t remember if this one is also an autogen.sh for CVS)
make

there you go, that should do it. It sounds like you’re not configuring
your
files properly. God, I hate autoconf.

Nicholas

Does Everybody here use Linux here ?

Vivien

I would think so. :-)–
Brian

That’s exactly that. I read everywhere to “configure”, but I run Win95, not
Linux, and configure is a Linux shell.
I don’t have /usr/local, ls etc but I do have make and tar.

I thought that programs written in SDL could be compiled either under Linux,
either under Win95. Isn’t that right ?

That’s right.
The correct magic is (I believe)
-lSDL -lmingw32 -lSDLmain -luser32 -lgdi32 -lwinmm -ldxguid -mwindows

If you have the Cygnus development environment, you can run configure
scripts on Win98. http://www.cygnus.com/
I haven’t set it up in a while, so I don’t know if it still works.

I have plenty of *.a in my lib directory, but if I “grep” WinMain, I only
get crt1.o,crt2.o,libSDLmain.a and libmingw32.a

Does Everybody here use Linux here ?

Nope. :slight_smile: Quite a few people develop in Windows, and I’ve even been
surprised by MacOS and Be developers.

I’m booted into BeOS right now to implement OpenGL support. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That’s exactly that. I read everywhere to “configure”, but I run Win95, not
Linux, and configure is a Linux shell.
I don’t have /usr/local, ls etc but I do have make and tar.

I thought that programs written in SDL could be compiled either under Linux,
either under Win95. Isn’t that right ?

Yes, it is.
It’s no problem to compile under MS Visual C++ - just unzip the
VisualC.zip file and open the project. That’s what I’ve done.

If you don’t use Visual C++, I’m sorry I have no solution.

I have plenty of *.a in my lib directory, but if I “grep” WinMain, I only
get crt1.o,crt2.o,libSDLmain.a and libmingw32.a

Does Everybody here use Linux here ?

No, e.g. I use Win98.

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.2 – QDPGP 2.61a
Comment: http://community.wow.net/grt/qdpgp.html

iQA/AwUBOISKNDEbf4Lf/iHxEQI4+wCg48gwxS21O09SQro2DITT9y2nkoMAoK+b
S+VLx6iWSWdGRzqgSvBFJhS5
=lL++
-----END PGP SIGNATURE-----On 18 Jan 00, at 8:58, Vivien TURMEL wrote:

Christian Biesinger
PGP ID: DFFE21F1; Get it at: http://biesinger.virtualave.net/biesi.asc
Fingerprint: E60D 24FC BBC5 97CE 5421 C0FE 311B 7F82 DFFE 21F1