I need some help...

Okay, I was following a tutorial EXACTLY and everything worked fine until the last part. I am basically making the hello world of 3d game programming. When I try to compile I get these errors:


main.cpp
c:\users\my computer\desktop\moar c++ stuff\game1\game1\main.cpp(42): error C2143: syntax error : missing ';' before '->'
c:\users\my computer\desktop\moar c++ stuff\game1\game1\main.cpp(42): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\users\my computer\desktop\moar c++ stuff\game1\game1\main.cpp(44): error C2059: syntax error : 'while'
c:\users\my computer\desktop\moar c++ stuff\game1\game1\main.cpp(45): error C2143: syntax error : missing ';' before '{'
c:\users\my computer\desktop\moar c++ stuff\game1\game1\main.cpp(45): error C2447: '{' : missing function header (old-style formal list?)
c:\users\my computer\desktop\moar c++ stuff\game1\game1\main.cpp(52): error C2143: syntax error : missing ';' before '->'
c:\users\my computer\desktop\moar c++ stuff\game1\game1\main.cpp(52): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\users\my computer\desktop\moar c++ stuff\game1\game1\main.cpp(53): error C2059: syntax error : 'return'
c:\users\my computer\desktop\moar c++ stuff\game1\game1\main.cpp(54): error C2059: syntax error : '}'
c:\users\my computer\desktop\moar c++ stuff\game1\game1\main.cpp(54): error C2143: syntax error : missing ';' before '}'
c:\users\my computer\desktop\moar c++ stuff\game1\game1\main.cpp(54): error C2059: syntax error : '}'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

So, here is my source code where the errors are underlined:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
IAnimatedMesh *mesh = smgr->getMesh("C:/Users/My Computer/Desktop/GameEngine/irrlicht-1.7.2/media/sydney.md2");
	if(!mesh)
{
	dev->drop();
	return 1;

}
	
	IAnimatedMeshSceneNode *node = smgr->addAnimatedMeshSceneNode(mesh);

	if(node)
		node->setMaterialFlag(EMF_LIGHTING, false);
		node->setMD2Animation(EMAT_STAND);
		node->setMaterialTexture(0, dri->getTexture("C:/Users/My Computer/Desktop/GameEngine/irrlicht-1.7.2/media/sydney.bmp"));
	}
	
	smgr->addCameraSceneNode(0,vector3df(0,30,-40), vector3df(0,5,0)); 
	
	while(dev->run())
{
	dri->beginScene(true, true, SColor(255, 100, 101, 140));
	smgr->drawAll();
	gui->drawAll();

	dri->endScene();
}
	dev->drop();
	return 0;
}


Visual C++ underlines: smgr->addCamera... , 'while', & 'return'.

So, my question to you guys is... what is causing my errors?
Where is the rest of your code? It looks like you are missing a left-curly brace after the "if" on line 11. At least ...
Are you compiling it with Win32 Application or with a Console Application?
Could you please post the link to the tutorial?

By the looks of it you just have tons of typos.
@ TheCoCkTa1l: If this was a linking error, which is what I assume you expect since you asked if he was compiling through the consult, then he would not have as far as compilation. Also the errors it throws are much different in that case.
Topic archived. No new replies allowed.