Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Visual C++ 2010 cout?
- - By danikaze Date 2011-01-31 19:58
Maybe it's a stupid problem, but I can't show anything in the console using std::cout to debug.
Actually, I don't have the console in a gosu project :-S (but I do have it in a standard project created in visual c++ 2010)

I'm a noob of Visual C++, but I managed to show the console making the project with Ctrl+F5 instead of F5 only, but anyway I didn't get anything from std::cout.

Can anybody help me?
Thanks in advance.
Parent - By danikaze Date 2011-01-31 20:10
I found the solution :)

This line was hiding the console (and the standard output)
#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")

So I changed it to
#ifdef NDEBUG
#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
#endif

I hope others can find this useful :)
Parent - - By Basic Date 2011-01-31 20:17
When you press Ctrl+F5 you are seeing the outputs of the build, rather than just the console.

Is this just for debugging? For debugging in Visual studio I use lots of breakpoints (Double click the gutter, and it adds a red ball then press F5).

I have I have a logging class that just outputs stuff to a textfile, but this is just for reference rather than debugging.

If you really want console stuff try AllocConsole on MSDN but I've never tried it tho.
http://msdn.microsoft.com/en-us/library/ms681944(v=vs.85).aspx
Parent - By danikaze Date 2011-02-01 10:38
Yes, I was using breakpoints :D

But anyway, I wanted to show some debug exit messages.

In the end, it's solved and I posted this just for reference, if other people have the same problem ;)
Up Topic Gosu / Gosu Exchange / Visual C++ 2010 cout?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill