Relo Template for Irrlicht.

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

I got it to compile! :D (now that I have installed windows sdk and added many command line options and defines I found in the original irrlicht.dsp)

but the linker part does not work for the moment :(

I'm still working on it....
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

I got it to work! :D 8)
Now I have a dll compiled with vc++ toolkit! hahahaha

The only thing that failed is the last step: the generation of irrlixht.exp and irrlicht.lib
In fact those files have been created in my source folder... maybe they are corrupted, I don't know.
(the size of irrlicht.lib is 2.2k and the official release is 3k)
But I think that it is not important because I can still use the official irrlicht.lib :wink:

the dll itself seems to be exactly the same as the official one (same size, etc)
I tested it and it WORKS! :D

I will post this evening a short tutorial explaining the steps to make a dll with relo and vc++ toolkit. Stay tuned.

The only problem is that people will need to download the windows platform sdk (more than 40MB even if you don't download the examples and the documentation) so I'm not sure if it is really useful. :?
But if someone make a patch for irrlicht (like IrrlichtNX project) then I will be able to re-compile the dll.

Anyway, I'm proud and very happy that I make it works! :D
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

I'm even more proud!!! It's a great job you're doing. I'm very glad we've taken this so far!!! and specially for your efforts and understanding of the toolkit.

I already got the sdk installed so I'll be counting the minutes for that tutorial!!!

congrats man!!! more stuff for the new tutorial!!!!


cheers!
Image
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

cmoibenlepro, did you add uuid.lib manually into the project?
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

(Sorry I didn't replied yesterday...)

What you need:
1) windows core sdk
2) directx sdk (headers and libraries)
3) relo and vc++ toolkit (of course :lol: )

What you do:
1) First there is a bug in Relo. :( ... If you add other folders in the "extra library paths" in the project options, it won't work.
This is because it use the /L option to add more lib folders and this is not a real option of MSVC++ ... (so this is why you get errors like LINK : warning LNK4044: unrecognized option '/LC:\DXSDK\lib'; ignored )

I don't know how to fix it and what options to use... But I found a solution, copy all the files that are in your directx/lib and Microsoft SDK/lib into your C:/Program Files/Microsoft Visual C++ Toolkit 2003/lib folder (if it is where you installed vc++)

2) Unzip Irrlicht source somewhere (I used C:/Irrlicht/source)

3)Go to your relo folder. Open config/compilers/msvc.ini
add the following lines:
[DLL Commands]
CompileCmd=cl "$IN" /c /Fo"$OUT" /I"$PATH\..\include" $CFLAGS /nologo
LinkCmd=link /DLL /NOLOGO /LIBPATH:"$PATH\..\lib" $LFLAGS $IN "/OUT:C:\irrlicht\source\irrlicht.dll"


(you can see that I added manually the output name for the dll with the /OUT option. This is because otherwise it tried to give it a .exe extension (another relo bug) instead of .dll . If you want to use another path, modify this option..)

4) Open Relo. click file/open project . change the type to "supported formats" . open c:/Irrlicht/source/Irrlicht.dsp
Wait some time...

5) Go to project options.
In the Linker tab: choose Windows DLL then check "create import library" and choose generate .DEF file
For the Extra libraries type:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib

In the Options tab:
Add this to the extra compiler switches:
/O2 /Og /D WIN32 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IRRLICHT_EXPORTS" /D "_MBCS" /D "_USRDLL"

In the directories tabL
Add to the extra include paths:
c:/DXSDK/include
c:/Microsoft sdk/include
c:/irrlicht/source/include
C:/Program Files/Microsoft Visual C++ Toolkit 2003/include
c:/irrlicht/source


do not add library paths because it doesn't work.
click OK.

6) Save your project (file/save project) so you don't need to set again all the options later.

7) click on "build" and cross your fingers... :P
after a while the dll should be generated with success.
..then it will try to generate irrlicht.exp and irrlicht.lib
and as I already said in my previous post it will fail I don't know why...

8 ) Give me your comments. :wink:
Last edited by cmoibenlepro on Fri Aug 06, 2004 6:40 pm, edited 2 times in total.
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Yes!
It works OK! 8)
Unbelievable but size of produced dll is smaller: 788 KB (806,912 bytes) vs 856 KB (876,544 bytes).
Thank you cmoibenlepro and afecelis for such great tutorials!
Now everyone can recompile Irrlicht engine using free software with no problem with D3D. :!:
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

H AHA HA AH AH AHAHA HA HA HA HA HA H A!!!!! (maniac laughter!!!!)

those r gr8 news Puh! And you're right, now everybody can compile the dll and use DX as well.

Cmoibelenbro, I got no idea how you came up with this! :wink:

And I thought I was tweaking Relo badly! hah ah ah ah ha ha

:oops:

Gonna try it in the office today. I got a final question Cmoibelenpro, will all these changes harm your template? (I kinda like the project wizard!)

I mean, do we have to set things one way for dlls and the template way for exes?

congrats again. If you consider things r final, I'll write v2.0 of my tutorial and before releasing it I'll send it to you for a check-up and approval of your stuff.

cheers!
Image
knightoflight
Posts: 199
Joined: Sun Aug 24, 2003 5:47 pm
Location: Germany

Post by knightoflight »

@afecelis:
You write in you tutorial for RELO that you think its better than DevC++. Just i was changing to DevC++, now i read this. Now i dont know should i change again to this ?
Whats better to DevC++ ? Smaller exe-files ? Quicker Run ? Better Handling ? For me the important thing is that the resultcode is quick.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

It works like a charm!!! My VC7 dll is 1.550 kb and the Relo one is 844. Outstanding! It seems lke the toolkit really optimizes stuff! Great work Cmoibelenpro. Let me know what you think of the new tutorial and any ideas for it.

@knightoflight:
Devc++ only compiles opengl. With the Relo work-around you can use directx, and most of MS standard stuff and libs. Besides, if you're used to Visualstudio you'll find Relo+MSVC toolkit to work in a very similar way.

ps. And you can compile optimzed exes (I've gotten the smallest exes with this, smaller than vc6 or vc7), and you got a nice tutorial, a nice template for new projects and now a nice dll thnx to Cmoibelenpro!!!

hope it helps.
Image
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

Yes!
It works OK!
It works like a charm!!!
I'm happy it works :D Thanks for your comments.
I got a final question Cmoibelenpro, will all these changes harm your template?
No. To compile the dll I changed the compiler settings. The wizard use the template settings.
I tested it and there is no conflicts, it still works.
I mean, do we have to set things one way for dlls and the template way for exes?
Yes.
Cmoibelenbro, I got no idea how you came up with this! And I thought I was tweaking Relo badly!
I didn't do anything special, I just opened the official VisualStudio project (irrlicht.dsp) with a text editor (I use SciTE) and checked what options were needed to compile the dll. Then, I added them to Relo and it worked. :D

BTW, when I will have time I will submit the bugs I found to the creator of Relo....
Last edited by cmoibenlepro on Fri Aug 06, 2004 6:44 pm, edited 1 time in total.
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

also if you want to know what means all the options of VC++ toolkit (and if you want to know where I found which command line options were needed to compile a DLL) check there:

http://msdn.microsoft.com/library/defau ... tegory.asp

http://msdn.microsoft.com/library/defau ... erence.asp

hope it helps!

Relo rocks! :D
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Relo kicks major butt!

Ever since I ran into it for the first time I got obsessed on getting it to work with a VC compiler. It already had borland support but I wanted it to do something else, something cooler but there wasn't a free ms vc compiler around. Then MS released the .net toolkit for free and wham! Things fell into place at the proper time. Love at first sight, ha ha hah a. And then, wham! you come up with the template and dll. We should make games together!!

I got this weekend planned to write the new tutorial. It's gonna be a major improvement of the original with your stuff in it (credits included). :D

About Reporting the bugs to Relo's author: he doesn't answer emails much. Nor anybody replies in his forums. I wrote him and sent him a copy of the tut and stuff but never got a reply. It would be great if you get any answer from him and get him to include the bug fixes for next release 1.0 (which seems to be the last one). Although V1.0 is also taking him a while. It seems like he's not workin on the project anymore.

Anyway, I'm more than sattisfied the way things are. Now I'm going to try to compile Audiere.dll for sound following your steps.

cheers, and thnx! I'll alway thank people like you who offer new things to life!
Image
knightoflight
Posts: 199
Joined: Sun Aug 24, 2003 5:47 pm
Location: Germany

Post by knightoflight »

@afecelis: thanks, ok i will try your Relo, too ;-)
btw: but for devc++ is a thread in the "how to"-section with name "How to get Direct X 8 in Dev-CPP"
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

@knightoflight:
yes it is possible to use dx8 with dev-cpp (not dx9) but there is some problems:
-you need to use the debug version of dx8 (-ld3dx8d) so the resulting irrlicht dll is a lot bigger (and also you must distribute the debug version of directx dll with your executable because most people don't have it in addition to irrlicht.dll) so it's better to use only opengl.

-vc++ toolkit have a professionnal quality optimizer and the compiled executables are smaller than those compiled with MinGW (dev-cpp compiler)
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

dx9 works, though same thing about needing a dll
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Post Reply