Can't link my project against SDL

Hi,

I started a project using SDL, but unfortunately I couldn?t get it to
link with MSVC .NET 2005
I linked againsat both SDL.lib and SDLMain.lib but I get a linker error
that the “entry point has to be specified”.
So it means it can?t find an entry point, but I do have a main method.
The project compiles fine until I include the SDL headers.
Could somebody tell me where the error is? Thanks in advance :slight_smile:

regards

Michael Stather

Hello Michael,

Tuesday, October 3, 2006, 1:10:05 AM, you wrote:

Hi,

I started a project using SDL, but unfortunately I couldn?t get it to
link with MSVC .NET 2005
I linked againsat both SDL.lib and SDLMain.lib but I get a linker error
that the “entry point has to be specified”.
So it means it can?t find an entry point, but I do have a main method.
The project compiles fine until I include the SDL headers.
Could somebody tell me where the error is? Thanks in advance :slight_smile:

You have used the wrong project type. You should use “Win32
Application” (which expects a WinMain() provided by SDLmain.lib), not
"Win32 Console Application".–
Best regards,
Peter mailto:@Peter_Mulholland

Peter Mulholland schrieb:

Hello Michael,

Tuesday, October 3, 2006, 1:10:05 AM, you wrote:

Hi,

I started a project using SDL, but unfortunately I couldn?t get it to
link with MSVC .NET 2005
I linked againsat both SDL.lib and SDLMain.lib but I get a linker error
that the “entry point has to be specified”.
So it means it can?t find an entry point, but I do have a main method.
The project compiles fine until I include the SDL headers.
Could somebody tell me where the error is? Thanks in advance :slight_smile:

You have used the wrong project type. You should use “Win32
Application” (which expects a WinMain() provided by SDLmain.lib), not
"Win32 Console Application".

Thanks, that worked :slight_smile:
Now I get a warning that msvcrtd.lib conflicts with other libraries and
I should use /nodefault, do you know why this happens?

regards

Michael

Hello Michael,

Tuesday, October 3, 2006, 11:07:48 AM, you wrote:

Thanks, that worked :slight_smile:
Now I get a warning that msvcrtd.lib conflicts with other libraries and
I should use /nodefault, do you know why this happens?

It happens because MSVC 2005 uses a different runtime library to what
SDLmain.lib is compiled for.

You can get around this in one of two ways:

  1. recompile SDL in MSVC 2005 so you get a compatible SDLmain.lib
  2. Add src/main/win32/SDL_win32_main.c to your project.–
    Best regards,
    Peter mailto:@Peter_Mulholland

David Olsen schrieb:> ----- Original Message -----

From: “Peter Mulholland”
To: "A list for developers using the SDL library. (includes SDL-announce)"

Sent: Tuesday, October 03, 2006 5:18 AM
Subject: Re: [SDL] Can??t link my project against SDL

Hello Michael,

Tuesday, October 3, 2006, 11:07:48 AM, you wrote:

Thanks, that worked :slight_smile:
Now I get a warning that msvcrtd.lib conflicts with other libraries and
I should use /nodefault, do you know why this happens?

It happens because MSVC 2005 uses a different runtime library to what
SDLmain.lib is compiled for.

You can get around this in one of two ways:

  1. recompile SDL in MSVC 2005 so you get a compatible SDLmain.lib
  2. Add src/main/win32/SDL_win32_main.c to your project.

I also use MSVC 2005 and I’ve never had to recompile SDL, or add
src/main/etc. to any of my projects to avoid this error/warning. I
occasionally get such an error if I try to include certain other libraries
(e.g. boost, or zziplib come to mind). Check on which other .lib’s you are
linking with.
(and check that you are compiling as “Multi-Threaded debug dll” in C/C++
compiler options.)
-Dave


Best regards,
Peter mailto:darkmatter at freeuk.com


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


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

The problem here is that I?m not including other libraries at all.
I?m also using the “multithreaded debug dll” setting .