win32/SDL newbie blues

hello all,

i’ve been having a woe or two trying to compile the additional libs for SDL under both the MSVC++ and mingw32 environments.I’ve read all the text i can get my hands on for the libs (SDL_net and SDL_ttf to be specific) and i get these problems:

In MSVC++:

I assumed that i could just #include the *.c and *.h files and be able to use the libs like that, but I get all sorts of symbol missing errors, so i figured it’s an issue of compiling the libs into DLLs and using them? (by this time you can tell i’m no guru by any means) When i make a DLL project for the libs, and do the compile I get:

for SDL_net:

SDLnet.obj : error LNK2001: unresolved external symbol _SDL_SetError
SDLnet.obj : error LNK2001: unresolved external symbol _WSAStartup at 8
SDLnet.obj : error LNK2001: unresolved external symbol _WSACancelBlockingCall at 0
SDLnet.obj : error LNK2001: unresolved external symbol _WSAGetLastError at 0
SDLnet.obj : error LNK2001: unresolved external symbol _WSACleanup at 0
SDLnet.obj : error LNK2001: unresolved external symbol _gethostbyname at 4
SDLnet.obj : error LNK2001: unresolved external symbol _inet_addr at 4
SDLnet.obj : error LNK2001: unresolved external symbol _gethostbyaddr at 12
Debug/SDL_net.dll : fatal error LNK1120: 8 unresolved externals

Is there a better way to go about using the alternate libs in the MSVC++ environment?

In mingw32:

When I “sh configure” on a config script, it hangs whenever it checks whether gcc works. I’m sure i have the right gcc in the $PATH, and I’ve tried setting other environment vars that others have suggested in the mailing list to no avail. Are there any suggestions to tweaking this environment for use with SDL?

these are probably dumb questions, but I’m stumped trying to compile for win32, i’m used to a configure/make/make install in linux taking care of everything for SDL… any help would be very much appreciated!!

Thanks,

-john

“John Lawrence” wrote

i’ve been having a woe or two trying to compile the additional
libs for SDL under both the MSVC++ and mingw32 environments.I’ve
read all the text i can get my hands on for the libs (SDL_net and
SDL_ttf to be specific) and i get these problems:

for SDL_net:

SDLnet.obj : error LNK2001: unresolved external symbol _SDL_SetError
SDLnet.obj : error LNK2001: unresolved external symbol _WSAStartup at 8

there is definitely work involved in getting the “extra” SDL
libraries compiled. it looks like your SDL_net is missing
winsock. add the following library to your project and you
should be cooking.
wsock32.lib
you might also need
ws2_32.lib

“John Lawrence” wrote

i’ve been having a woe or two trying to compile the additional
libs for SDL under both the MSVC++ and mingw32 environments.I’ve
read all the text i can get my hands on for the libs (SDL_net and
SDL_ttf to be specific) and i get these problems:

for SDL_net:

SDLnet.obj : error LNK2001: unresolved external symbol _SDL_SetError
SDLnet.obj : error LNK2001: unresolved external symbol _WSAStartup at 8

there is definitely work involved in getting the “extra” SDL
libraries compiled. it looks like your SDL_net is missing
winsock. add the following library to your project and you
should be cooking.
wsock32.lib
you might also need
ws2_32.lib

One of my goals for this weekend is to release new versions of the extra
SDL libraries along with VC++ projects so that people can build them easily.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software