need help starting

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
love_child
Posts: 8
Joined: Sat Jun 24, 2006 11:15 pm

need help starting

Post by love_child »

Okay, I am very new to this, and I don't have much coding experience, just enough to get a taste if you know what i mean. How do I get Irrlicht started? The C++ program that I have is Microsoft visual studio express edition. But I think that i have to download an sdk thing for that program and that would not be very possible on dial-up because the download for that thing is like 300mb or something like that and my computer can't do it. If anyone could give me an alternative that my internet could actually download and get me started up on irrlicht, I would very happy. :D
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, you don't need to download it unless you want to recompile Irrlicht. Please go to the Irrlicht homepage and read the tutorials available there. They will definitely help you with your taks (and us to save thousands of keystrokes).
love_child
Posts: 8
Joined: Sat Jun 24, 2006 11:15 pm

Post by love_child »

Okay, well, i tried the tutoril on hello world but using the express edition of visual studio as if it was the .net version. It was supprising how it seemed to fill in blanks, as if there was no diference in .net and express. But I ran into a problem, when i tried to to compile the code, it had a problem, and the code is as follows:


Code: Select all

#include <irrlicht.h>
using namespace irr;
#pragma comment (lib, "Irrlicht.lib")
int main()
{
IrrlichtDevice *device =
				createDevice(EDT_SOFTWARE, dimension2d<s32>(512, 384), 16,
						false, false, false, 0);
device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
guienv->addStaticText(L"Hello World! This is the Irrlicht Software engine!",
		rect<int>10,10,200,22), true);
IAnimatedMesh* mesh = smgr->getMesh("C/Documents and Settings/Owner/My Documents/aaron/irrlicht-1.0/irrlicht-1.0/media/sydney.md2");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
if (node)
{
		node->setMaterialFlag(EMF_LIGHTING, false;
		node->setFrameLoop(0, 310);
		node->setMaterialTexture( 0, driver->getTexture("C/Documents and Settings/Owner/My Documents/aaron/irrlicht-1.0/irrlicht-1.0/media/sydney.bmp");
}
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
while(device->run())
{
	driver->beginScene(true, true, SColor(0,200,200,200));

	smgr->drawAll();
	guienv->drawAll();

	driver->endScene();
}
	device->drop();
return 0;
}


then, when i clicked the compile message, i got this:


------ Build started: Project: Hello world, Configuration: Debug Win32 ------
Compiling...
Hello world.cpp
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world\hello world\hello world.cpp(36) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
Build log was saved at "file://c:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\Hello world\Hello world\Debug\BuildLog.htm"
Hello world - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


so, i didn't get it to work, yet, got any other idea's?
boboS
Posts: 188
Joined: Tue Oct 18, 2005 6:36 pm
Location: Romania

Post by boboS »

Why dont u read the error ?
Did you forget to add '#include "stdafx.h"' to your source? :D
As your ship is going down
ll stand by and watch you drown
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Better disable precompiled headers as they just introduce problems to the compile process (or be sure to have everything correctly set up for that)
love_child
Posts: 8
Joined: Sat Jun 24, 2006 11:15 pm

Post by love_child »

okay, how do you disable the headers? Also, i tried the same as before but i left the header that they put on the window and the header was:

Code: Select all

// Hello World.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
	return 0;
}




When I tried this, i got close to the same message but got this error instead:  "c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world\hello world\hello world.cpp(4) : fatal error C1083: Cannot open precompiled header file: 'Debug\Hello World.pch': No such file or directory"

Do you know what is wrong this time?
t0mmy
Posts: 10
Joined: Wed Jun 21, 2006 9:44 am
Location: Tuebingen, Germany
Contact:

Post by t0mmy »

Somewhere in the menue "Project->[projectname] options" you'll find "Configuration properties" -> c/c++ -> "precompiled headers".
there you can say "not using precompiled headers".

May be different in your IDE, I'm using VS.net 2005
love_child
Posts: 8
Joined: Sat Jun 24, 2006 11:15 pm

Post by love_child »

Okay, i tried to not use the precompiled headers, which i found was in a different place then where you said. It didn't work, i think made it worse. I basically copy and pasted the code from hello world into the code and got this message when compiling:


------ Build started: Project: hello world 2, Configuration: Debug Win32 ------
Compiling...
hello world 2.cpp
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(18) : error C2065: 'EDT_SOFTWARE' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(18) : error C2065: 'dimension2d' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(18) : error C2275: 'irr::s32' : illegal use of this type as an expression
c:\documents and settings\owner\my documents\aaron\irrlicht-1.0\irrlicht-1.0\include\irrtypes.h(41) : see declaration of 'irr::s32'
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(21) : error C2065: 'IVideoDriver' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(21) : error C2065: 'driver' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(22) : error C2065: 'ISceneManager' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(22) : error C2065: 'smgr' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(23) : error C2065: 'IGUIEnvironment' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(23) : error C2065: 'guienv' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(24) : error C2227: left of '->addStaticText' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(25) : error C2065: 'rect' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(25) : error C2062: type 'int' unexpected
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(26) : error C2065: 'IAnimatedMesh' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(26) : error C2065: 'mesh' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(26) : error C2227: left of '->getMesh' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(27) : error C2065: 'IAnimatedMeshSceneNode' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(27) : error C2065: 'node' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(27) : error C2227: left of '->addAnimatedMeshSceneNode' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(30) : error C2227: left of '->setMaterialFlag' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(30) : error C2065: 'EMF_LIGHTING' : undeclared identifier
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(31) : error C2227: left of '->setFrameLoop' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(32) : error C2227: left of '->setMaterialTexture' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(32) : error C2227: left of '->getTexture' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(34) : error C2227: left of '->addCameraSceneNode' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(34) : error C3861: 'vector3df': identifier not found
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(34) : error C3861: 'vector3df': identifier not found
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(37) : error C2227: left of '->beginScene' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(37) : error C3861: 'SColor': identifier not found
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(39) : error C2227: left of '->drawAll' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(40) : error C2227: left of '->drawAll' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings\owner\my documents\visual studio 2005\projects\hello world 2\hello world 2\hello world 2.cpp(42) : error C2227: left of '->endScene' must point to class/struct/union/generic type
type is ''unknown-type''
Build log was saved at "file://c:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\hello world 2\hello world 2\Debug\BuildLog.htm"
hello world 2 - 31 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, two steps back. Please learn how to use your IDE/compiler :!:
You have to correctly add include path so the headers are still found (you just don't use them precompiled). And be sure that you still have the '#include "irrSomething.h"' in your files.
rooly
Posts: 224
Joined: Tue Oct 25, 2005 4:32 pm
Location: Louisiana, USA, backwater country
Contact:

Post by rooly »

look, its simple. MSVC screws most of us, just use code::blocks. if you don't feel like setting anything up at all, just use dev-c++. the express edition doesn't have alot of the things you often need for compilation. just get another, always better, IDE. you'll have a much easier time

there's that, and make sure you use the included projects for each example, and study their setup's
When banks compete, you win.
When ISPs compete, you win.
When electronics retailers compete, you win.
When governments compete...you get drafted.
osxus3r
Posts: 2
Joined: Sun Jun 25, 2006 11:03 pm
Contact:

Post by osxus3r »

lucky you guys . I wish things were that simple on mac os
love_child
Posts: 8
Joined: Sat Jun 24, 2006 11:15 pm

Post by love_child »

Ok, i had a feeling that i was getting gypped. Let me get this straight, code blocks is basically a different brand of C++ compiler along with Dev C++, right? Is it easy to download through dial-up, or if it is large, could it be downloaded through the internet explorer download manager so that i could send it to a program to download it in small chunks? Thanks for all of your help in this, i have been trying to get a game engine going for a while and had nothing but failer.

p.s. I know this is very off topic and doesn't apply to irrlicht, AT ALL, but to osxus3r, what is the difference in a mac and a pc, I have been a pc user for all my life pretty much so i wouldn't know.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

a compiler is the bit that compiles text source code into binary form so you can run it. an IDE is a fancy graphical interface for a compiler. Dev-C++ is an IDE that uses the mingw compiler, MSVS is an IDE that uses MSVC compiler, Borland C++ is an IDE that uses Borland's compiler. code::blocks is an IDE that can many compilers. c::b is hosted on sourceforge, so yes you can use a download manager.
love_child wrote:what is the difference in a mac and a pc
not much nowadays :lol:
Basicaly its a BSD running status symbol of a PC that costs a fortune but looks really cool. They are favoured mostly by non techies like graphic artists, journalists, and ipod owning, goatee wearing snowboarders from the pepsi max adverts.. duuuuude
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
love_child
Posts: 8
Joined: Sat Jun 24, 2006 11:15 pm

Post by love_child »

Well, i have downloaded the Code::Blocks thing with the MinGW package, so hopefully that would work, now i just have to figure out how to do everything with it.
love_child
Posts: 8
Joined: Sat Jun 24, 2006 11:15 pm

Post by love_child »

ok, i am on code::blocks now, and i tried the hello world again, but on c::b. I got the package with the MinGW, but when i try to compile the file, I get the following message in the build log:

Compiling: main.cpp
mingw32-g++.exe: /GX: No such file or directory
mingw32-g++.exe: /W3: No such file or directory
mingw32-g++.exe: /Ox: No such file or directory
Process terminated with status 1 (0 minutes, 2 seconds)
0 errors, 0 warnings

Why is it doing that, anyone could help?
Post Reply