Getting Irrlicht to work with Dev-C++
Getting Irrlicht to work with Dev-C++
Hello, I am trying to get Irrlicht to work with Dev-C++. I have successfully added the include files to the include folder in C:/Dev-Cpp/include/. However I cannot find where to put the file Irrlicht.dll. I have placed it in essentially every folder I could think of within Dev-Cpp/ but none worked. Is this even the right file? Do I need a .a file?
Other info:
Using Windows 7 Home
My code successfully compiles until I call device = createDevice(...
Other info:
Using Windows 7 Home
My code successfully compiles until I call device = createDevice(...
Re: Getting Irrlicht to work with Dev-C++
.dll should be put together with your program .exeSleddog wrote:Hello, I am trying to get Irrlicht to work with Dev-C++. I have successfully added the include files to the include folder in C:/Dev-Cpp/include/. However I cannot find where to put the file Irrlicht.dll. I have placed it in essentially every folder I could think of within Dev-Cpp/ but none worked. Is this even the right file? Do I need a .a file?
Other info:
Using Windows 7 Home
My code successfully compiles until I call device = createDevice(...
.a is the one which should be linked to the compiler
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
Re: Getting Irrlicht to work with Dev-C++
Good to know, but it did not fix my problem. I put the .dll in the folder with my .exe, as well as the .a in Dev-Cpp/lib (and combinations of those), but it didn't help. Any other suggestions?Virion wrote:.dll should be put together with your program .exe
.a is the one which should be linked to the compiler
nono i didn't mean that you should put the .a into the same folder as your exe
link it with linker settings of your compiler
link it with linker settings of your compiler
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
Please post the exact error - just copy & paste this. Do this always when you get an error instead of trying to describe it. You seem to mix something up - dll's are not even needed in compiling - they are only needed at runtime. Maybe you get a linker error? That would be the missing link-library (the .a) which has to be in your linker-path (you can add folders to the linker-path in your IDE - usually called "linker directories" or something similar).
Also we usually recommend switching to code::blocks (also called C::B) as the Dev-C++ development seems to have stopped a few years ago and so we don't really support it anymore.
Also we usually recommend switching to code::blocks (also called C::B) as the Dev-C++ development seems to have stopped a few years ago and so we don't really support it anymore.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
k... Heres the code:
// HelloUniverse.cpp
// Include the Irrlicht header
#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,false,
0);
irrDevice->setWindowCaption(L"Dev-C++ and the Irrlicht Engine!");
IVideoDriver* irrDriver = irrDevice->getVideoDriver();
ISceneManager* irrSceneMgr = irrDevice->getSceneManager();
IGUIEnvironment* irrGUIEnv = irrDevice->getGUIEnvironment();
irrGUIEnv->addStaticText( L"Hello World! This is the Irrlicht software engine!",
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);
}
and here's the error messages:
Compiler Default compiler
Building Makefile: "C:\Dev-Cpp\Irrdemo\Makefile.win"
Executing make clean
rm -f ello.o Irrdemo.exe
g++.exe -c ello.cpp -o ello.o -|"C/Program Files/Irrlict-1.6/include"
ello.cpp ln function 'int main()":
ello.cpp 19: error: invalid initialization of reference of type 'const irr::core::dimension2d<irr::u32>&' from expression of type 'irr::core::dimension2d<irr::s32>'
C:/Program Files/Irrlicht-1.6/include/irrlicht.h:329: error: in passing argument 2 of 'irr::lrrlichtDevice* irr::creatDevice(irr::video::E_DRIVER_TYPE, const irr::core::dimensions2d<irr::u32>&, irr::u32, bool, bool, bool, irr::lEventReceiver*)'
make.exe: ***[ello.o] Error 1
execution terminated
I have my linkers linking but I'm missing something that's just out of my paripheral vision.
Tim
// HelloUniverse.cpp
// Include the Irrlicht header
#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,false,
0);
irrDevice->setWindowCaption(L"Dev-C++ and the Irrlicht Engine!");
IVideoDriver* irrDriver = irrDevice->getVideoDriver();
ISceneManager* irrSceneMgr = irrDevice->getSceneManager();
IGUIEnvironment* irrGUIEnv = irrDevice->getGUIEnvironment();
irrGUIEnv->addStaticText( L"Hello World! This is the Irrlicht software engine!",
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);
}
and here's the error messages:
Compiler Default compiler
Building Makefile: "C:\Dev-Cpp\Irrdemo\Makefile.win"
Executing make clean
rm -f ello.o Irrdemo.exe
g++.exe -c ello.cpp -o ello.o -|"C/Program Files/Irrlict-1.6/include"
ello.cpp ln function 'int main()":
ello.cpp 19: error: invalid initialization of reference of type 'const irr::core::dimension2d<irr::u32>&' from expression of type 'irr::core::dimension2d<irr::s32>'
C:/Program Files/Irrlicht-1.6/include/irrlicht.h:329: error: in passing argument 2 of 'irr::lrrlichtDevice* irr::creatDevice(irr::video::E_DRIVER_TYPE, const irr::core::dimensions2d<irr::u32>&, irr::u32, bool, bool, bool, irr::lEventReceiver*)'
make.exe: ***[ello.o] Error 1
execution terminated
I have my linkers linking but I'm missing something that's just out of my paripheral vision.
Tim
code happens
Heres how it worked for me
note that i use wxdevc++ which is more or less the same
=> Step 1: U need Irrlicht.dll compiled with dx support which isnt the case w.r.t the gcc distribution. Get it from
http://www.gprogs.com/irrlicht.mod/IrrDX_v1_6.zip
=> Step 2: Copy that file ie(Irrlicht.dll) and the other dll file( ie D3DX81ab.dll) to the system32 folder on ur comp.
( If u arent able to find it just go to start->run-> type "system32")
=> Step 3: Include the irrlicht include folder into the C & C++ includes of ur Directories tab which can be accessed from Tools=>Compiler Options=>Directories
in my case i extracted irrlicht 1.6 to my devcpp folder itself
so it is as follows
=> Step 4: After extracting the zip file ie (Irr DX_v1_6.zip) to a folder, copy the file libIrrlicht.a to a directory preferably ur project directory
and add it to the linker as follows
Project=>Project Options=>Parameters=> Add Library or object
and select that file ie libIrrlicht.a
In my case i extracted it to the folder win32-gcc
so it is as follows
=> Step 5: Well thats about it. Make sure the path to the stuff u use from ur drive ie the media files etc etc is given correctly
And now you are good to go
try this prog out i used EDT_DIRECT3D9 just to show that it works
u can use EDT_OPENGL or others
BTW, dont forget to add it to the project mate )
Thats about it. Hope it helped
Cheerio,
knapshots
note that i use wxdevc++ which is more or less the same
=> Step 1: U need Irrlicht.dll compiled with dx support which isnt the case w.r.t the gcc distribution. Get it from
http://www.gprogs.com/irrlicht.mod/IrrDX_v1_6.zip
=> Step 2: Copy that file ie(Irrlicht.dll) and the other dll file( ie D3DX81ab.dll) to the system32 folder on ur comp.
( If u arent able to find it just go to start->run-> type "system32")
=> Step 3: Include the irrlicht include folder into the C & C++ includes of ur Directories tab which can be accessed from Tools=>Compiler Options=>Directories
in my case i extracted irrlicht 1.6 to my devcpp folder itself
so it is as follows
=> Step 4: After extracting the zip file ie (Irr DX_v1_6.zip) to a folder, copy the file libIrrlicht.a to a directory preferably ur project directory
and add it to the linker as follows
Project=>Project Options=>Parameters=> Add Library or object
and select that file ie libIrrlicht.a
In my case i extracted it to the folder win32-gcc
so it is as follows
=> Step 5: Well thats about it. Make sure the path to the stuff u use from ur drive ie the media files etc etc is given correctly
And now you are good to go
try this prog out i used EDT_DIRECT3D9 just to show that it works
u can use EDT_OPENGL or others
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main()
{
IrrlichtDevice *irrDevice =
createDevice( video::EDT_DIRECT3D9, dimension2d<u32>(640, 480), 16,
false, false, false, 0);
if (!irrDevice)
return 1;
irrDevice->setWindowCaption(L"Dev-C++ and the Irrlicht Engine!");
IVideoDriver* irrDriver = irrDevice->getVideoDriver();
ISceneManager* irrSceneMgr = irrDevice->getSceneManager();
IGUIEnvironment* irrGUIEnv = irrDevice->getGUIEnvironment();
irrGUIEnv->addStaticText(
L"Hello World! This is the Irrlicht engine!",
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);
}
BTW, dont forget to add it to the project mate )
Thats about it. Hope it helped
Cheerio,
knapshots
Sorry for the long delay, the wife kidnaped me for a long weekend and I was tottaly without my internet addiction.
I downloaded the IrrDX_v1_6.zip and put the D3DX81a.dll in the system32 file where I previously dropped the Irrlicht.dll file.
I recompiled as is and came up with the same errors. Since the .dll's should't kick in untill after the compilation and into the run cycle I determined it isnt the .dll's...
I compared next my linkers to the linkers you have listed in the includes...
I dont have the OpenCV program... what is it and where can I get it ??
Thanks
Tim
I downloaded the IrrDX_v1_6.zip and put the D3DX81a.dll in the system32 file where I previously dropped the Irrlicht.dll file.
I recompiled as is and came up with the same errors. Since the .dll's should't kick in untill after the compilation and into the run cycle I determined it isnt the .dll's...
I compared next my linkers to the linkers you have listed in the includes...
I dont have the OpenCV program... what is it and where can I get it ??
Thanks
Tim
code happens
Code: Select all
ello.cpp 19: error: invalid initialization of reference of type 'const irr::core::dimension2d<irr::u32>&' from expression of type 'irr::core::dimension2d<irr::s32>'
C:/Program Files/Irrlicht-1.6/include/irrlicht.h:329: error: in passing argument 2 of 'irr::lrrlichtDevice* irr::creatDevice(irr::video::E_DRIVER_TYPE, const irr::core::dimensions2d<irr::u32>&, irr::u32, bool, bool, bool, irr::lEventReceiver*)'
Change this line:
Code: Select all
IrrlichtDevice *irrDevice = createDevice(EDT_SOFTWARE,
dimension2d<s32>(512, 384),
16,false,false,
0);
Code: Select all
IrrlichtDevice *irrDevice = createDevice(EDT_SOFTWARE,
dimension2d<u32>(512, 384),
16,false,false,
0);
Thanks Bitplane, that took care of that error but now I have a linker error.
In projct options / Parameters / Linkers I have the files:
../../Program Files/irrlicht-1.6/lib/Win32-gcc/libIrrlicht.a
../lib/libjpeg.a
../lib/libz.a
as directed by preivious suggestions tutorials.
And they apprently are not being recocognised (or not found) according to the new error msg:
Executing Make...
Make.exe -f "C:\Dev-CPP\Irrdemo\makefile.win" all
g++.exe ello.o -o "Irrdemo.exe" -L "C:/Program Files/Irrlicht-1.6/lib" ../../Program Files/irrlicht-1.6/lib/Win32-gcc/libIrrlicht.a ../lib/libjpeg.a ../lib/libz.a
g++.exe: ../../Program. No such file or directory
g++.exe: Files/Irrlicht-1.6/lib/Win32-gcc/libIrrlicht.a No such file or directory
Make.exe: ***[Irrdemo.exe] Error 1
Execution terminated
I confirmed the locations of the files but they are not linking correctly... What the filibuster am I still doing wrong ???
Tim
In projct options / Parameters / Linkers I have the files:
../../Program Files/irrlicht-1.6/lib/Win32-gcc/libIrrlicht.a
../lib/libjpeg.a
../lib/libz.a
as directed by preivious suggestions tutorials.
And they apprently are not being recocognised (or not found) according to the new error msg:
Executing Make...
Make.exe -f "C:\Dev-CPP\Irrdemo\makefile.win" all
g++.exe ello.o -o "Irrdemo.exe" -L "C:/Program Files/Irrlicht-1.6/lib" ../../Program Files/irrlicht-1.6/lib/Win32-gcc/libIrrlicht.a ../lib/libjpeg.a ../lib/libz.a
g++.exe: ../../Program. No such file or directory
g++.exe: Files/Irrlicht-1.6/lib/Win32-gcc/libIrrlicht.a No such file or directory
Make.exe: ***[Irrdemo.exe] Error 1
Execution terminated
I confirmed the locations of the files but they are not linking correctly... What the filibuster am I still doing wrong ???
Tim
code happens
-
- Posts: 26
- Joined: Sat Jan 02, 2010 12:48 pm
Never Mind...
I cleared out the linker files and re- added them to the project and it ran correctly. woot!!!
I pickd up Borland C++ way back in college and it never seemed to want to work with any other code... I got rid of it finnally last lear cuzz I heard Dev was easyer to work with... I have yet to see that proven except it will run standard code better than my old Borland. I hate being behind the curve in learning a new compiler !!!
Tim
I cleared out the linker files and re- added them to the project and it ran correctly. woot!!!
I pickd up Borland C++ way back in college and it never seemed to want to work with any other code... I got rid of it finnally last lear cuzz I heard Dev was easyer to work with... I have yet to see that proven except it will run standard code better than my old Borland. I hate being behind the curve in learning a new compiler !!!
Tim
code happens
I'm curious, did you not just try double clicking on one of the dev-cpp project files in the examples directory?
If they don't work out of the box then that's a bug!
Also, Dev-C++ is pretty old and no longer updated, the open source flavour of the month (past few years) is code::blocks, which is a much nicer IDE (imo)
If they don't work out of the box then that's a bug!
Also, Dev-C++ is pretty old and no longer updated, the open source flavour of the month (past few years) is code::blocks, which is a much nicer IDE (imo)
I did... none of them compiled correctly. So I took one of the basic tuttorials with the list of linker files and tried to work my way backards from there.
From the looks of it it may have been the simple changing the s32 to u32... I saw that in another forum and didnt think anything of it becouse there was no explination
I have not heard of code::block untill I hit this forum group. it looks like an inhanced struct class manipulator... is there a site I can look furthr into it ??
Tim
From the looks of it it may have been the simple changing the s32 to u32... I saw that in another forum and didnt think anything of it becouse there was no explination
I have not heard of code::block untill I hit this forum group. it looks like an inhanced struct class manipulator... is there a site I can look furthr into it ??
Tim
code happens
Yep, you can get a copy here:
http://www.codeblocks.org/
It has the advantage of running on Windows and Linux, it uses the same project files for both
http://www.codeblocks.org/
It has the advantage of running on Windows and Linux, it uses the same project files for both