Rename Irrlicht.dll

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Rename Irrlicht.dll

Post by LunaRebirth »

Hey guys, So I've caught myself in sort of a tight space here.

My friend is a very great programmer, and she doesn't use Irrlicht.
In an attempt to be "better" than her, I figured I'd make a nice Irrlicht program to say "I made this" and watch her awe.

But I'm afraid if I send her the file, she'll see "Irrlicht.dll" and see how I did it and tell me how she's better with her "custom-made" stuff (Yes, she's like that).

I'm not even sure this is possible, but I've already told her I'm just adding a few stuff and will let her have it to play.
Is there any quick way I can rename Irrlicht.dll and still use it Dev-C++??

Kind of in a rush here, sorry for the long story.

Please please please let me know if this is possible and what I can do.

EDIT:
This is just a show-off thing. I'm not actually going to release this, just want to impress her.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Rename Irrlicht.dll

Post by hendu »

Use a static library instead of shared, then no dll to include.
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Rename Irrlicht.dll

Post by LunaRebirth »

How do I use a static library? Is there a separate download of Irrlicht for this? Will this screw any of my current code up?

Edit:
I'm using Dev-C++ (GCC). How can I go about removing the DLL?
Thanks for the helpful answer!!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Rename Irrlicht.dll

Post by hybrid »

You need to recompile Irrlicht as static, there's a dedicated build target for that. Then you need to define the IRR_STATIC also when compiling your code (esp. when linking). The Irrlicht.a file will fully dissolve into your executable then.
Dev-C++ is unsupported, though, so you may have to copy over and adapt the project files from an older Irrlicht version - or change your dev environment.
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Rename Irrlicht.dll

Post by LunaRebirth »

I'm using 1.5, which seems to be supported for this (Found http://irrlicht.sourceforge.net/forum/v ... p?p=200806)
But I don't know how to compile it as static, or even what that means.

Where is the dedicated build target located for this? I can't seem to find it.
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Rename Irrlicht.dll

Post by LunaRebirth »

I'm assuming this means to take Irrlicht.dev and compile it?
In doing so, Dev-C++ crashes. May be a Windows8 thing.
Or is that not correct?
http://irrlicht.sourceforge.net/forum/v ... hp?t=28892
I can do steps 2 and 3, but I don't understand step 1.

This is in my compiler options. It says static. Just thought I'd bring it up in case it has any meaning what-so-ever for this topic.
-static-libstdc++ -static-libgcc
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Rename Irrlicht.dll

Post by LunaRebirth »

Just installed Code::Blocks and got my program set up to it.
So if all else fails and I can't get the static linking to work for Dev-C++, I've got back up.
Can someone explain what I need to do to get rid of the DLL for Dev-C++ OR Code::Blocks?

Would like help by this week, if all possible. Slowly buying myself more time "Wanting to add more to leave a good impression."

EDIT:
I'm really wanting to try, so I went through a lot on Code::Blocks putting some stuff together.
Instead of including Irrlicht.h, I included everything BUT Irrlicht.h
My program still works, but is that what I'm supposed to do?
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Rename Irrlicht.dll

Post by LunaRebirth »

Can someone please help show me how to make it static?
CuteAlien
Admin
Posts: 9733
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Rename Irrlicht.dll

Post by CuteAlien »

When you use Code::blocks then the Irrlicht.cbp project file in source/Irrlicht should already have build-targets for static builds. Enable "View - Toolbars - Compiler". Then you have drop-down menu with build-target options. Select the one which says something about release static.

Then in your application in "build-options, defines" add the define _IRR_STATIC_LIB_ (that's the one Hybrid had meant). You can find the same define in the static build target of Irrlicht.cbp (it has to be set on both sides - the library and in the application code to work). Also maybe delete the Irrlicht.dll because g++ prefers using shared libraries when it finds both and might just ignore the static library otherwise (you can also force it somehow, but you have to google that).
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
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Rename Irrlicht.dll

Post by LunaRebirth »

Not going to lie, when I saw your name next to the "Advanced Help" link (shows who posted last), I was like "Yesss!"
Haven't tried your method yet, but excited to hop to it.
Let you know how it goes, thank you.:)
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Rename Irrlicht.dll

Post by LunaRebirth »

I don't see any drop-down build-target options with release static.
The drop-down only shows "default." I've also tried looking up how to get this button, to no help

EDIT:
I tried building Irrlicht.cpp first, and I get a few errors:

Code: Select all

In member function 'virtual const path& irr::io::CFileSystem::getWorkingDirectory()':|
|515|error: '_MAX_PATH' was not declared in this scope|
|521|error: 'tmp' was not declared in this scope|
In member function 'virtual irr::io::path irr::io::CFileSystem::getAbsolutePath(const path&) const':|
|614|error: '_MAX_PATH' was not declared in this scope|
|620|error: 'fpath' was not declared in this scope|
|620|error: '_fullpath' was not declared in this scope|
EDIT 2:
Nevermind, I had to use the Irrlicht-gcc.cbp instead of just Irrlicht.cbp

However, I pressed build and I'm still getting the same errors listed in Edit1.
Doing some research, but still haven't found an answer online.
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Rename Irrlicht.dll

Post by LunaRebirth »

Sorry for posting so much.

I've found this link, which you're in http://irrlicht.sourceforge.net/forum/v ... ed#p282848 and thank god he/she let everyone know the solution, because now it's working. After everything is built, what do I do?

Is there something it created that I now need to include instead of the DLL?
I do not see anything out of ordinary and the DLL is still required.

Thanks for the help, I can't say how much help this has been.
CuteAlien
Admin
Posts: 9733
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Rename Irrlicht.dll

Post by CuteAlien »

Right, there is Irrlicht-gcc, I forgot about that. I also just see (again) that our target names are too long to fit in the drop-down menu (at least on my PC). You can select the target as well by Build - Select Target - "Win32 - Release - accurate math - static" (or debug if you ever need to debug Irrlicht itself).

Note that you can't compile & run the examples afterward without setting the _IRR_STATIC_LIB_ define in their compile settings (same as you have to do in your own application). We have made no extra static build targets for those so far (we should probably do that).

You have to link your application against the resulting libIrrlicht.a - it should be in lib\Win32-gcc. So make sure that path is in your linker path. That should be all. You should notice your resulting application is now larger than before (as it links some stuff from libIrrlicht.a directly into your executable - thought not all of it - only the stuff it needs).
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
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Rename Irrlicht.dll

Post by LunaRebirth »

Sweet! Thank you. Yes, the .a is abnormally big.
But now I get tons of errors. I saw some gl errors in there, but had to rush to work before I can actually look through them.

Possibly I need to include OpenGL and stuff now (I read somewhere)?
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Rename Irrlicht.dll

Post by LunaRebirth »

Alright, I'm going to list my errors and what I've done to try to fix them.
Sorry for being so complicated on this topic, I feel like I'm making this more difficult than it really needs to be.

-So I've downloaded Irrlicht 1.8.1 and built it as the static, also removed the .dll. This worked fine and gives no errors.
-I then moved the .a file and linked it into my project.
-Here's the error I get now:

Code: Select all

|762|undefined reference to `_imp__createDeviceEx'|
-Doing as mentioned in a previous reply on this forum, I've added "_IRR_STATIC_LIB_" to my project (Since I had done this to the Irrlicht Engine, and not my project)
-Said error (createDeviceEx) is no longer a problem. New errors:
(Took a picture, because I didn't know how to select copy multiple errors at once)
http://imgur.com/dLdDPYD

Again, I'll be doing some research until I get a response here. Will post if I've figured it out in the mean time.:)

Thanks again, all of you. Been great help and greatly appreciated. Sorry for the difficulties.
Post Reply