MSVC 6 and SDL 1.2

Hello,

I’m trying to get SDL 1.2 working in MSVC 6, but I have been experiencing
issues when trying link my project. I have set the code generation to multi-
threaded dll already, and included sdl.lib and sdl_main.lib, but those didn’t
work. So I physically dropped those to lib files into the project’s file list
and tried that, but it didn’t work either. I then included sdl_main.c into
the project, and now I’ve got an error that there seems to be no resources on
the 'net for. What I’m getting now is:

SDL_main.obj : error LNK2001: unresolved external symbol _SDL_SetModuleHandle
Debug/sdl_trade.exe : fatal error LNK1120: 1 unresolved externals

Any Ideas?

Thanks,
Dade-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/

Try linking SDL.lib and SDLmain.lib (no underscore). That is what I use with
MSVC 6 and it works great.

Steven> ----- Original Message -----

From: sdl-admin@libsdl.org [mailto:sdl-admin at libsdl.org]On Behalf Of
dade at ravingninja.com
Sent: Thursday, September 04, 2003 11:36 AM
To: sdl at libsdl.org
Subject: [SDL] MSVC 6 and SDL 1.2

Hello,

I’m trying to get SDL 1.2 working in MSVC 6, but I have been experiencing
issues when trying link my project. I have set the code generation to
multi-
threaded dll already, and included sdl.lib and sdl_main.lib, but those
didn’t
work. So I physically dropped those to lib files into the project’s file
list
and tried that, but it didn’t work either. I then included sdl_main.c into
the project, and now I’ve got an error that there seems to be no resources
on
the 'net for. What I’m getting now is:

SDL_main.obj : error LNK2001: unresolved external symbol
_SDL_SetModuleHandle
Debug/sdl_trade.exe : fatal error LNK1120: 1 unresolved externals

Any Ideas?

Thanks,
Dade


This mail sent through IMP: http://horde.org/imp/


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hello

Thursday, September 4, 2003, 10:36:26 PM, you wrote:

I’m trying to get SDL 1.2 working in MSVC 6, but I have been experiencing
issues when trying link my project. I have set the code generation to multi-
threaded dll already, and included sdl.lib and sdl_main.lib, but those didn’t
work. So I physically dropped those to lib files into the project’s file list
and tried that, but it didn’t work either. I then included sdl_main.c into
the project, and now I’ve got an error that there seems to be no resources on
the 'net for. What I’m getting now is:

SDL_main.obj : error LNK2001: unresolved external symbol _SDL_SetModuleHandle
Debug/sdl_trade.exe : fatal error LNK1120: 1 unresolved externals

I’m have SDL 1.2.4
It’s work fine with Visual C++ 6
See carefully VisualC.html!–
Best regards,
Sashnov Alexander mailto:@Sashnov_Alexander

You should have to add SDL_main.c to your project…

What I do is just copy SDL.LIB and SDLmain.lib to my project folder,
then add these two to my Project->Settings->Link->Object/Library Modules
(you can skip the copy part, and just reference these files with a full
Path like c:\winnt\sdl_lib\ or something).

Then I make sure the checkbox for Ignore all default Libraries is NOT
Checked (I have had problems with this before).

Now you just have to be sure that your main looks something like this,

int main(int argc, char* argv[] )
{

}

Oh, and your project should be a Win32 Console Application…

Also, check that your are including al the necessary Header Files.

Another important thing is to check that you have "Multithreaded DLL"
In Project->Settings->C/C+±>[Combo]:Code Generation->Use Run-time
Library.

This is all I can remember for now…
Good Luck

Juan Ignacio Carniglia - Programmer - Buenos Aires, Argentina.> -----Original Message-----

From: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] On
Behalf Of Sashnov Alexander
Sent: Saturday, September 06, 2003 2:01 PM
To: dade at ravingninja.com
Subject: Re: [SDL] MSVC 6 and SDL 1.2

Hello

Thursday, September 4, 2003, 10:36:26 PM, you wrote:

I’m trying to get SDL 1.2 working in MSVC 6, but I have been
experiencing issues when trying link my project. I have
set the code
generation to multi- threaded dll already, and included sdl.lib and
sdl_main.lib, but those didn’t work. So I physically
dropped those to
lib files into the project’s file list and tried that, but
it didn’t
work either. I then included sdl_main.c into the project, and now
I’ve got an error that there seems to be no resources on
the 'net for.
What I’m getting now is:

SDL_main.obj : error LNK2001: unresolved external symbol
_SDL_SetModuleHandle
Debug/sdl_trade.exe : fatal error LNK1120: 1 unresolved externals

I’m have SDL 1.2.4
It’s work fine with Visual C++ 6
See carefully VisualC.html!


Best regards,
Sashnov Alexander mailto:sashnov at ngs.ru


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

[snip]

Oh, and your project should be a Win32 Console Application…

Is this really required? I’m pretty sure SDLmain.lib provides a winmain().
I’m about 98% certain that I always specified “win32 application” instead of
"win32 console app" when creating my projects under visual studio…
Not to say a console app doesn’t work, but you don’t want to go linking in
stuff you don’t need…

Ben.On Sunday 07 September 2003 4:09 pm, Juan Ignacio Carniglia wrote:

Yes, the only time you should make a win32 console app is if you want a console
window popping up for debugging purposes.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment> On Sunday 07 September 2003 4:09 pm, Juan Ignacio Carniglia wrote:

[snip]

Oh, and your project should be a Win32 Console Application…

Is this really required? I’m pretty sure SDLmain.lib provides a winmain().
I’m about 98% certain that I always specified “win32 application” instead of
"win32 console app" when creating my projects under visual studio…