PcWizKid Posted September 8, 2011 Share Posted September 8, 2011 I just wrote the simple program in c++ and tried compiling it I keep getting a few errors that i cant seem to fix. here is my code: #include "Engine.h" int main(int argc, char** argv) { //Load engine Dll Initialize(); //Create Main Game graphics window Graphics (800,600,0,0,GRAPHICS_BACKBUFFER+GRAPHICS_DEPHBUFFER); //Create World ;CreateWorld(); //Create a camera TEntity cam; cam=CreateCamera(0); MoveEntity(cam,Vec3(0,0,-5)); //Create Cube CreateCube(0); //MainLoop while (!KeyHit(KEY_ESCAPE)) { //UpdateWorld UpdateWorld(1); //Render the world RenderWorld(RENDER_ALL); //FLip Buffer Flip(1); } Terminate(); return 0 } } and here are the errors im getting 1>------ Build started: Project: DarkAge, Configuration: Debug Win32 ------1>Compiling... 1>DarkAge.cpp 1>c:\users\pointersoftworks\desktop\projects\darkage\darkage\darkage.cpp(20) : error C2065: 'GRAPHICS_DEPHBUFFER' : undeclared identifier 1>c:\users\pointersoftworks\desktop\projects\darkage\darkage\darkage.cpp(51) : error C2143: syntax error : missing ';' before '}' 1>c:\users\pointersoftworks\desktop\projects\darkage\darkage\darkage.cpp(56) : error C2059: syntax error : '}' 1>c:\users\pointersoftworks\desktop\projects\darkage\darkage\darkage.cpp(56) : error C2143: syntax error : missing ';' before '}' 1>c:\users\pointersoftworks\desktop\projects\darkage\darkage\darkage.cpp(56) : error C2059: syntax error : '}' 1>Build log was saved at "file://c:\Users\PointerSoftworks\Desktop\Projects\DarkAge\DarkAge\Debug\BuildLog.htm" 1>DarkAge - 5 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Quote Link to comment Share on other sites More sharing options...
macklebee Posted September 8, 2011 Share Posted September 8, 2011 whats a DEPHBUFFER? and why a semicolon before CreateWorld? and fyi, the button '<>' in the menu bar is for code... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
PcWizKid Posted September 8, 2011 Author Share Posted September 8, 2011 Corrected this problems still no fix Quote Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted September 8, 2011 Share Posted September 8, 2011 The error console says it all 1. GRAPHICS_DEPHBUFFER should be GRAPHICS_DEPTHBUFFER (You missed the 'T') 2. and ;CreateWorld(); should be CreateWorld (); (Don't put a semi colon before CreateWorld()....... 3. You have too many of } these. Parenthesis always need to match up.so delete the last one You should learn what the error messages mean. eg: error C2065: 'GRAPHICS_DEPHBUFFER' : undeclared identifier means that the compiler doesn't know what GRAPHICS_DEPHBUFFER is..... first thing to do is to check your spelling because it has to be exact or the computers not gonna guess what you meant 1>c:\users\pointersoftworks\desktop\projects\darkage\darkage\darkage.cpp(51) : error C2143: syntax error : missing ';' before '}' Syntax errors usually come down to missing a ; or having mis-matching parenthesis ({}) etc. Double click on the error messages and it should show you exactly where they problem is in most of these cases. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
PcWizKid Posted September 8, 2011 Author Share Posted September 8, 2011 now a error box is popping up saying "Unhandled exception at 0x00000000 in DarkAge.exe: 0xC0000005: Access violation." Quote Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted September 9, 2011 Share Posted September 9, 2011 now a error box is popping up saying "Unhandled exception at 0x00000000 in DarkAge.exe: 0xC0000005: Access violation." Hmm the only thing I can see is this: #include "Engine.h" It should read #include "engine.h" C++ is case sensitive so you need to specify it it exactly as its written. Also make sure you set up your VC++ project correctly. Have you used C++ before or is this your first time? If you haven't used it much before I would suggest going to www.cprogramming.com and do the c++ beginners tutorial and getting some of the basics down. It will help you get to know it better. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Rick Posted September 9, 2011 Share Posted September 9, 2011 Is your exe in the same dir as your dll's? Are all your resources in the right spot? Quote Link to comment Share on other sites More sharing options...
Roland Posted September 9, 2011 Share Posted September 9, 2011 Hi PcWizKid I can see that you are new to C++ programming. Nothing bad about that, you are welcome Everyone has to start somewhere. Here is my recommendation to you. Use the LEBuilder to create a C++ project for you. This way you will be sure that everything is correctly setup regarding Visual Studio files and paths. Study the created 'rotating cube' sample so you understand whats going on. If there are things that you doesn't understand in that sample don't shy to ask in the forum. We will help When you understand the sample you can wipe out the sample code and replace it with your own, or change the sample code at your desires. Good luck Roland Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
PcWizKid Posted September 10, 2011 Author Share Posted September 10, 2011 Thanks for the help Roland and everyone else. I deeply appreciate it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.