Just want an easy way of making output, for testing purposes.
I was doing it the old way, by using cout, but I had to use #include <iostream>, #include <stdlib.h> and "using namespace std;" which I noticed added a huge amount of compile time - 10 seconds with it, as opposed to 1 second without (using the HelloWorld example).
I examined how Irrlicht.dll does it, it uses os::Printer::log("text stuff"); but I couldn't get it to work. I tried importing os.h like Irrlicht.dll does, and it says "os.h not found".
Best way to output to the console window?
You have a few ways to go about it. If cout was working, you could always just use printf instead.
One, if you want to use system headers, stuff will compile a whole lot faster if you use precompiled headers. It's what they are for, to speed up compiling.
Since you mention the Irrlicht DLL, I'm guessing you are on windows. You can also use OutputDebugString. You will need something to display output sent to OutputDebugString then, tho. I use dbmon.exe or just run in the debugger to see it.
If you are writing a console app (you have no winmain), then you can just use printf (ugh!). If you do have a winmain, you could always alloc yourself a console with AllocConsole, and printf to that too.
If you aren't using VC++, then you can reference the docs for the above functions at http://msdn.microsoft.com.
If you are using linux, you can likely just printf, and the output will go to a console somewhere.
One, if you want to use system headers, stuff will compile a whole lot faster if you use precompiled headers. It's what they are for, to speed up compiling.
Since you mention the Irrlicht DLL, I'm guessing you are on windows. You can also use OutputDebugString. You will need something to display output sent to OutputDebugString then, tho. I use dbmon.exe or just run in the debugger to see it.
If you are writing a console app (you have no winmain), then you can just use printf (ugh!). If you do have a winmain, you could always alloc yourself a console with AllocConsole, and printf to that too.
If you aren't using VC++, then you can reference the docs for the above functions at http://msdn.microsoft.com.
If you are using linux, you can likely just printf, and the output will go to a console somewhere.
No, printf is not a c++ keyword. It's normal function from stdio.h. You didn't have to include it because stdio.h must be already included somewhere in the irrlicht.
Tomasz Nowakowski
Openoko - www.openoko.pl
Openoko - www.openoko.pl
Argh! I meant the API! Sorry.
Well I don't know what everyone calls the "big help file for C++", but in Java, its called the API.
http://java.sun.com/j2se/1.3/docs/api/
And for Irrlicht, it's the \doc\index.chm
Where is the equivelant thing for C++?
(That's bad - I'm asking a C++ question on the wrong forum.)
Well I don't know what everyone calls the "big help file for C++", but in Java, its called the API.
http://java.sun.com/j2se/1.3/docs/api/
And for Irrlicht, it's the \doc\index.chm
Where is the equivelant thing for C++?
(That's bad - I'm asking a C++ question on the wrong forum.)
FYI, I found one here;
http://www.cppreference.com/
http://www.cppreference.com/