Compiling sdl application with msvc

After adding google-breakpad to my project and a failed attempt at getting it cross-compiling with mingw-w64 ( would need to code a PE-DWARF reader which is way over my head ) I booted into windows to try compile my game with msvc++ comandline.
Got it to the point where all the pieces compile with this line…

cl.exe /DWIN32 /D_DEBUG /Gm /RTC1 /nologo /I…/…/google-breakpad-windows/src /EHsc /MDd /DWIN32 /D_WIN32 /DUNICODE /D_UNICODE /Zi engine.cpp …/…/google-breakpad-windows/src/client/windows/handler/exception_handler.cc
…/…/google-breakpad-windows/src/client/windows/crash_generation/crash_generation_client.cc …/…/google-breakpad-windows/src/common/windows/guid_string.cc …/common/lib/init.obj …/common/lib/timer.obj …/common/lib/texture.obj …/common/lib/draw.obj …/common/lib/collision.obj …/common/lib/shuffle.obj …/common/lib/generator.obj …/common/lib/path.obj …/common/lib/menu.obj SDLmain.lib SDL.lib opengl32.lib glu32.lib SDL_image.lib SDL_mixer.lib SDL_ttf.lib

but it outputs one error, with the linking
LINK : fatal error LNK1561: entry point must be defined

engine.cpp has a standard main function ( int main(int argc, char *argv[]) { )…

been searching forums and trying different things, even tried to figure out the MS IDE, with no luck.
can anyone see what I’m doing wrong from the commandline.

Thanks,
Image

Try adding /SUBSYSTEM:CONSOLE or /SUBSYSTEM:WINDOWSOn Fri, May 13, 2011 at 12:45 AM, image28 wrote:

After adding google-breakpad to my project and a failed attempt at
getting it cross-compiling with mingw-w64 ( would need to code a PE-DWARF
reader which is way over my head ) I booted into windows to try compile my
game with msvc++ comandline.
Got it to the point where all the pieces compile with this line…

cl.exe /DWIN32 /D_DEBUG /Gm /RTC1 /nologo
/I…/…/google-breakpad-windows/src /EHsc /MDd /DWIN32 /D_WIN32 /DUNICODE
/D_UNICODE /Zi engine.cpp
…/…/google-breakpad-windows/src/client/windows/handler/exception_handler.cc

…/…/google-breakpad-windows/src/client/windows/crash_generation/crash_generation_client.cc
…/…/google-breakpad-windows/src/common/windows/guid_string.cc
…/common/lib/init.obj …/common/lib/timer.obj …/common/lib/texture.obj
…/common/lib/draw.obj …/common/lib/collision.obj …/common/lib/shuffle.obj
…/common/lib/generator.obj …/common/lib/path.obj …/common/lib/menu.obj
SDLmain.lib SDL.lib opengl32.lib glu32.lib SDL_image.lib SDL_mixer.lib
SDL_ttf.lib

but it outputs one error, with the linking
LINK : fatal error LNK1561: entry point must be defined

engine.cpp has a standard main function ( int main(int argc, char *argv[])
{ )…

been searching forums and trying different things, even tried to figure out
the MS IDE, with no luck.
can anyone see what I’m doing wrong from the commandline.

Thanks,
Image


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Using vc++ 2008, which doesn’t seem to have a subsystem option.
it’s outputing…

ignoring unknown option ‘/SUBSYSTEM:console’

was a linker option… Game is compiled an running with google-breakpad crash reporting :slight_smile:

Thanks heaps.
Kevin

Just a long shot… are you linking SDLmain.lib (along with SDL)? Make sure
you include SDL_main.h (or perhaps SDL.h is good enough) in the .cpp where
your main() is defined too. SDL does some macro work to change main into
WinMain I believe.

If it helps, I have documented the
stepshttps://glutinous.fogbugz.com/default.asp?W2I use to build SDL
for my game on MS VC 2k8 (and cmake). It is for v1.2, but
the steps are no different for 1.3.–
Steven Kah Hien Wong (@Steven_Kah_Hien_Wong)

On 14 May 2011 22:02, image28 wrote:

was a linker option… Game is compiled an running with google-breakpad
crash reporting [image: Smile]

Thanks heaps.
Kevin


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Oh ignore my last email, didn’t read your log properly. :)–
Steven Kah Hien Wong (@Steven_Kah_Hien_Wong)

On 16 May 2011 09:51, Steven Kah Hien Wong <@Steven_Kah_Hien_Wong> wrote:

Just a long shot… are you linking SDLmain.lib (along with SDL)? Make sure
you include SDL_main.h (or perhaps SDL.h is good enough) in the .cpp where
your main() is defined too. SDL does some macro work to change main into
WinMain I believe.

If it helps, I have documented the stepshttps://glutinous.fogbugz.com/default.asp?W2I use to build SDL for my game on MS VC 2k8 (and cmake). It is for v1.2, but
the steps are no different for 1.3.


Steven Kah Hien Wong (@Steven_Kah_Hien_Wong)

On 14 May 2011 22:02, image28 wrote:

was a linker option… Game is compiled an running with google-breakpad
crash reporting [image: Smile]

Thanks heaps.
Kevin


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org