AW: stdout e cout in Win32

“Sam Lantinga” ha scritto nel messaggio
news:E19G8uO-00080G-00 at twomix.devolution.com

If i use subsystem:windows in debug mode, my cout<<* output goes too
into stdout.txt !!

That’s correct. SDL redirects output to a file so that you have a record
of it for bug reports (it wouldn’t go anywhere else otherwise).

This is exactly what I want…
but with a standard project with MS VC++ 6
it doesn’t work with debug configuration and subsystem:windows…
it only works with release configuration…

Can anyone try this, please ?
Or if you want, I can send my empty project that doesn’t work…–
Bye!

Hi,

I was wondering if you, or one of the libraries you use, are linking to
both ‘MSVCRT.DLL’ and ‘MSVCRTD.DLL’? This can happen when not using
debug versions of everything that you link to.

There are often strange effects because you can end up with multiple copies
of globals. ‘errno’ once got me, but aren’t stdin/out/err global as well?

The ‘Dependancy Walker’ (depends.exe) tool:

http://www.dependencywalker.com/

is very useful for showing exactly what DLLs your application is linked to.
A version of it comes with MS VC++ 6,

good luck,
John.> ----- Original Message -----

From: skunkguru@hotmail.com (SkunkGuru)
To:
Sent: Thursday, May 15, 2003 8:14 AM
Subject: [SDL] Re: AW: stdout e cout in Win32

“Sam Lantinga” ha scritto nel messaggio
news:E19G8uO-00080G-00 at twomix.devolution.com

If i use subsystem:windows in debug mode, my cout<<* output goes too
into stdout.txt !!

That’s correct. SDL redirects output to a file so that you have a
record

of it for bug reports (it wouldn’t go anywhere else otherwise).

This is exactly what I want…
but with a standard project with MS VC++ 6
it doesn’t work with debug configuration and subsystem:windows…
it only works with release configuration…

Can anyone try this, please ?
Or if you want, I can send my empty project that doesn’t work…


Bye!


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

Ok, send me your project, i will test it with vc.net 2003.

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/

-----Urspr?ngliche Nachricht-----Von: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von
SkunkGuru
Gesendet: Donnerstag, 15. Mai 2003 09:14
An: sdl at libsdl.org
Betreff: [SDL] Re: AW: stdout e cout in Win32

“Sam Lantinga” ha scritto nel messaggio
news:E19G8uO-00080G-00 at twomix.devolution.com

If i use subsystem:windows in debug mode, my cout<<* output goes too

into stdout.txt !!

That’s correct. SDL redirects output to a file so that you have a
record of it for bug reports (it wouldn’t go anywhere else otherwise).

This is exactly what I want…
but with a standard project with MS VC++ 6
it doesn’t work with debug configuration and subsystem:windows… it
only works with release configuration…

Can anyone try this, please ?
Or if you want, I can send my empty project that doesn’t work…


Bye!


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

“John Popplewell” ha scritto nel messaggio
news:001401c31ac4$1171f8e0$6400a8c0 at blake…

I was wondering if you, or one of the libraries you use, are linking to
both ‘MSVCRT.DLL’ and ‘MSVCRTD.DLL’? This can happen when not using
debug versions of everything that you link to.

You’re right!
I changed the run-time library from “Multithreaded DLL” into "Debug
Multithreaded DLL"
and now in works in debug configuration too.

But it gives me a warning:

MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib "msvcrt.lib"
conflicts with use of other libs; use /NODEFAULTLIB:library

I added msvcrt.lib in the “Ignore libraries” section and now it compiles
without warning and erros.
And it correctly redirects output to stdout.txt for printf and std::cout.

But is this all correct ?
Is there a way to statically link the runtime C++ library (not the sdl
library) in VC++ ,
to avoid this kind of problem (and to have a single exe working
without the MS*.DLL) ?

P.S. Maybe this first solution can go in the Win32-FAQ…–
Bye.

Hi,

the only reliable solution I’ve found is to build a debug version of
all of the dependencies from scratch. Then there is no need for
"Ignore libraries" hacks.

Is there a way to statically link the runtime C++ library (not the sdl
library) in VC++ ,

SDL itself links to “msvcrt.lib” as do:

freetype-2.0.6
jpeg-6b
libpng-1.2.4
sdl_image-1.2
sdl_mixer-1.2
sdl_net-1.2
sdl_ttf-2.0.7
smpeg-0.4
xiph/ogg
xiph/vorbis
zlib

So you pretty much have to use it for your applications. Anyway, it makes
the executable smaller … A version of “msvcrt.lib” (not the debug
version) is present on Win98 upwards.

I go for the lib/ and libd/ directory name solution, where the release and
debug builds of the DLLs have the same name, but are in different dirs. and
have different library include paths in the release and debug MSVC project,

cheers,
John.> ----- Original Message -----

From: skunkguru@hotmail.com (SkunkGuru)
To:
Sent: Thursday, May 15, 2003 2:37 PM
Subject: [SDL] Re: Re: AW: stdout e cout in Win32

“John Popplewell” <@John_Popplewell> ha scritto nel messaggio
news:001401c31ac4$1171f8e0$6400a8c0 at blake…

I was wondering if you, or one of the libraries you use, are linking to
both ‘MSVCRT.DLL’ and ‘MSVCRTD.DLL’? This can happen when not using
debug versions of everything that you link to.

You’re right!
I changed the run-time library from “Multithreaded DLL” into "Debug
Multithreaded DLL"
and now in works in debug configuration too.

But it gives me a warning:

MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib "msvcrt.lib"
conflicts with use of other libs; use /NODEFAULTLIB:library

I added msvcrt.lib in the “Ignore libraries” section and now it compiles
without warning and erros.
And it correctly redirects output to stdout.txt for printf and std::cout.

But is this all correct ?
Is there a way to statically link the runtime C++ library (not the sdl
library) in VC++ ,
to avoid this kind of problem (and to have a single exe working
without the MS*.DLL) ?

P.S. Maybe this first solution can go in the Win32-FAQ…


Bye.


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