Index: setup.py =================================================================== RCS file: /cvsroot/py2exe/py2exe/setup.py,v retrieving revision 1.40 diff -u -r1.40 setup.py --- setup.py 1 Jun 2004 18:34:00 -0000 1.40 +++ setup.py 20 Aug 2004 08:55:04 -0000 @@ -114,6 +114,14 @@ extra_args = inter.extra_compile_args or [] + #Compiler options might be different for + #'console' and 'windows' executables + extra_preargs = [] + if inter.target_desc in ('console', 'windows'): + if self.compiler.compiler_type in ('mingw32', 'cygwin'): + extra_preargs = ['-m%s' % inter.target_desc] + inter.target_desc = 'executable' + macros = inter.define_macros[:] for undef in inter.undef_macros: macros.append((undef,)) @@ -123,6 +131,7 @@ macros=macros, include_dirs=inter.include_dirs, debug=self.debug, + extra_preargs=extra_preargs, extra_postargs=extra_args) if inter.extra_objects: @@ -151,6 +160,7 @@ libraries=self.get_libraries(inter), library_dirs=inter.library_dirs, runtime_library_dirs=inter.runtime_library_dirs, + extra_preargs=extra_preargs, extra_postargs=extra_args, debug=self.debug) else: @@ -298,11 +308,13 @@ run = Interpreter("py2exe.run", ["source/run.c", "source/start.c", "source/icon.rc"], + target_desc = "console", ) run_w = Interpreter("py2exe.run_w", ["source/run_w.c", "source/start.c", "source/icon.rc"], libraries=["user32"], + target_desc = "windows", ) run_dll = Interpreter("py2exe.run_dll", Index: source/py2exe_util.c =================================================================== RCS file: /cvsroot/py2exe/py2exe/source/py2exe_util.c,v retrieving revision 1.13 diff -u -r1.13 py2exe_util.c --- source/py2exe_util.c 30 Jul 2004 13:55:22 -0000 1.13 +++ source/py2exe_util.c 20 Aug 2004 08:56:46 -0000 @@ -45,7 +45,7 @@ (LPSTR) &lpMsgBuf, 0, NULL); - sprintf(Buffer, "%s: %s", msg, lpMsgBuf); + sprintf(Buffer, "%s: %s", msg, (char*)lpMsgBuf); LocalFree (lpMsgBuf); PyErr_SetString(PyExc_RuntimeError, Buffer); return NULL;