[SDL] Re: SDL and MFC

Jeremie jeremie.cretegny at cpnv.ch
Tue Jan 11 04:43:38 PST 2005

Carlos Alvarez <citrouille <at> wanadoo.fr> writes:

> Yes you can use SDL within MFC project.
> Did you set the projet as a Multithreaded DLL project (Multithreaded Debug
> DLL for debug configuration) ?
> cya
> Carlos
> ----- Original Message -----
> From: "Jeremie" <jeremie.cretegny <at> cpnv.ch>
> To: <sdl <at> libsdl.org>
> Sent: Monday, January 10, 2005 10:39 AM
> Subject: [SDL] SDL and MFC
> > Hello,
> > I try to use SDL with MS-Visual C++ and MFC.
> >
> > When I compile the project, I have an unresolved external symbol for the
> main
> > function.
> >
> > The problem is that SDL will a main function and the main function is a
> "hidden
> > function" from MFC...
> >
> > How Can I use MFC AND SDL in the same project???????
> >
> >
> >
> > _______________________________________________
> > SDL mailing list
> > SDL <at> libsdl.org
> > http://www.libsdl.org/mailman/listinfo/sdl
> >

Yes the project is Multithreadad DLL and the MFC is in shared DLL too.

Since we include SDL library, when we build the project we have this error
during the linking operation:

sdlmain.lib(SDL_win32_main.obj) : error LNK2001: unresolved external symbol

It's normal because we don't have main or WinMain function, it's the MFC who run
the classes.

If we put a main or a WinMain function, we don't have error but it's this main
function that starts the program!

So the question is:
Can we say to SDL that our main function IS the MFC main function?
What must we put in the main function for the program boot normally (i think
something like the code of the MFC main function but i'm not sure and i'm not a
pro in MFC...)

More information about the SDL mailing list