Error 1 in Dev-C++

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
ShideKnight
Posts: 2
Joined: Sun Jun 03, 2007 5:01 am

Error 1 in Dev-C++

Post by ShideKnight »

So... I compile the tutorials and get that error. I even tried writting my own program with a basic boilerplate and a createDevice call... I thought it was a problem with linking to the includes and librarys at first, but now i'm not sure, because I went through and did the linking and includes in a couple different ways. So, what kind of error is this? Here's an example of code I found... somewhere in a tutorial to try out:

Code: Select all

// Irrlicht Project Template
#include "irrlicht.h"

// Irrlicht Namespaces
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;


int main()
{
    IrrlichtDevice *irrDevice = createDevice(EDT_SOFTWARE, dimension2d<s32>(512, 384),16,false,true,false,0);
                                          
    irrDevice->setWindowCaption(L"Dev-C++ Irrlicht Engine Template");
    
    IVideoDriver* irrDriver = irrDevice->getVideoDriver();
    ISceneManager* irrSceneMgr = irrDevice->getSceneManager();
    IGUIEnvironment* irrGUIEnv = irrDevice->getGUIEnvironment();

    irrGUIEnv->addStaticText(L"Hello World! Irrlicht Project is here!!", rect<int>(10,10,200,30), true, true, 0, -1);

    while(irrDevice->run())
    { 
        irrDriver->beginScene(true, true, SColor(0,192,192,192));
                
                irrSceneMgr->drawAll();
                irrGUIEnv->drawAll();
                
	    irrDriver->endScene();
	}
    irrDevice->drop();
    return(0);
}
Since it's still not working, I guess it would have to be something with Dev-C++ not finding the right files, but I don't know. I'd love any help... or even being pointed in the right direction. This is frusterating.

Edited for stray tags (>.<)
Nuisance
Posts: 2
Joined: Sat Apr 07, 2007 5:41 am
Location: Connecticut, US

Post by Nuisance »

What was the error, and are you sure you got the library file and include folder linked right? The program ran fine when I tried it.
linkoraclehero
Posts: 81
Joined: Sat Sep 09, 2006 6:46 am

Post by linkoraclehero »

Error 1 usually means a BAD problem :P
Could mean gcc not found, but it could also mean a typo in the linker lines. Check the compile log tab and copy it all into here (Remember, Ctrl+C won't work in Dev-C++)
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

I hate "error 1" because 99% of the time it doesn't actually tell you what it is.

Compile 5 or 6 times; once in a while it throws a real error message after repeated compling.

Delete all you make and o files... sometimes that helps.

Make absolutely sure your libs are in the right directories.

Try adding the #pragma comment(lib, libirrlicht) or whatever it is -.-

^to expand on "ctrl-c wont work"... in case you aren't aware... if you right click and error line then the context menu has copy in it... you have to do it for every single line -.-
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

or is it a bug of dev-c++? because i heard people are saying that dev-c++ is very unstable and buggy. just a though.
linkoraclehero
Posts: 81
Joined: Sat Sep 09, 2006 6:46 am

Post by linkoraclehero »

Like I said, check the compile log. A missing EXE will report "Error 1". And it's best to upgrade to wxDev-C++ anyway. It's more up-to-date.
linkoraclehero
Posts: 81
Joined: Sat Sep 09, 2006 6:46 am

Post by linkoraclehero »

ShideKnight
Posts: 2
Joined: Sun Jun 03, 2007 5:01 am

Post by ShideKnight »

Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\Andy Millington\My Documents\Into the Light\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\Andy Millington\My Documents\Into the Light\Makefile.win" all
g++.exe -c Untitled1.cpp -o Untitled1.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/irrlicht-1.3/irrlicht-1.3/include" -I"C:/irrlicht-1.3/irrlicht-1.3/include" -fexpensive-optimizations -O3

g++.exe Untitled1.o Project1_private.res -o "Project1.exe" -L"C:/Dev-Cpp/lib" -L"C:/irrlicht-1.3/irrlicht-1.3/lib/Win32-gcc" -L"C:/irrlicht-1.3/irrlicht-1.3/include" -L"C:/irrlicht-1.3/irrlicht-1.3/lib" -mwindows ../irrlicht-1.3/lib/Win32-gcc/libIrrlicht.a -s

g++.exe: ../irrlicht-1.3/lib/Win32-gcc/libIrrlicht.a: No such file or directory

make.exe: *** [Project1.exe] Error 1

Execution terminated

...it's not finding libIrrlicht.a >.>

---

Okay, so as it turns out, Dev-C++ put in an incomplete path name for the library. I figured it was shorthand... it's working now.

Thanks everyone.
linkoraclehero
Posts: 81
Joined: Sat Sep 09, 2006 6:46 am

Post by linkoraclehero »

Mhm, always check the compile log. The Dev-C++ Error window is helpful, but it can't parse the output properly sometimes.
Post Reply