trying to use std::Vector

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

trying to use std::Vector

Post by keless »

Hey, I'm using Dev-CPP and trying to compile an Irrlicht project. It compiles fine before, but now I am trying to use std::vector, and I am getting a compiler error.

It seems that std::vector includes a file called unknwn.h which has this line:
typedef IUnknown *LPUNKNOWN;

this seems to be conflicting with IrrLicht's
class IUnknown{ ... }; in IUnknown.h

Has anyone used std::vector with IrrLicht? Am I doing something wrong?

Thanks,
-Keless
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Yeah... you need to remove the namespaces to be able to Identify Irrlichts IUnknown from stl's (or DirectX's).

Remove the "using namespace irr;" and add the specifications to each Irrlicht function. Example: "ISceneNode*" would be "irr::scene::ISceneNode*"
Crud, how do I do this again?
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

ouch! okay.

3-line long function declarations, here I come. :wink:
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

okay, I've explicitly declared all of my irr:: spaced objects (no more 'using namespace irr; ),

my first test was to #include <windows.h> and use
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
instead of
int main()

and-- it compiles! but it _crashes! Oh no.

I do get some output, maybe you know what it means?:
uncompress(): hello, hello!
gzread(): hello, hello!
gzgets() after gzseek: hello!
inflate(): hello, hello!
large_inflate(): OK
after inflateSync(): hello, hello!
inflate with dictionary: hello, hello!
((then: "This program has performed an illegal operation.. yada yada"))

Looks like IRR is starting up, setting its FileSystem? But whats causing the crash? (I am in DevCpp, running IRR 4.0)
Guest

Post by Guest »

Use int main() instead of INT WINAPI WinMain()
:twisted:
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

A. That's not an option if you want to remove the console or add an icon to the EXE file
B. Way to revive a 6 month old dead topic, lol
Post Reply