How do I tell Visual Studio 2010 where the irrlicht.lib is?
How do I tell Visual Studio 2010 where the irrlicht.lib is?
I tried
#pragma comment(lib, "Irrlicht.lib")
but it didn't work.
How do I tell Visual Studio 2010 Ultimate where to find Irrlicht.lib?
Any help would be much appreciated.
#pragma comment(lib, "Irrlicht.lib")
but it didn't work.
How do I tell Visual Studio 2010 Ultimate where to find Irrlicht.lib?
Any help would be much appreciated.
mongoose7 wrote:Arrgh, really, you have to get to know your compiler.[/b]
Go into Project > Properties and open the Link tab. While you are there, have a look at some of the other tabs as well.
IDE
@Kortalh, copying is probably the worst thing you could do. It can start causing lots of linker errors once you recompile your library and forget to copy it over to every project using it.
Working on game: Marrbles (Currently stopped).
If Irrlicht is in a fixed folder relative to your project you can try to get your IDE to copy the dll automatically after compiling. I think xcopy /D can be used on Windows to copy a file only when it's newer, so that can be used to copy a dll each time it has been changed. I'm not on Windows right now, so not sure how to add post-build commands in VS, but it's probably called something like post-build steps or similar.
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
Here's what my IDE's documentation told me to do: http://msdn.microsoft.com/en-us/library/ba1z7822.aspx
Which I followed to the letter.
I'm in Project > Properties > Linker > Input, and added Irrlicht.lib to the list of Additional Dependencies. Sadly, my IDE still couldn't find the lib file.
I'd love to do it the proper way, so if anyone can clue me in on what I'm missing I'd be majorly thankful. But, thanks for the tip Kortalh. I think I'll do it your way in the meantime.[/i]
Which I followed to the letter.
I'm in Project > Properties > Linker > Input, and added Irrlicht.lib to the list of Additional Dependencies. Sadly, my IDE still couldn't find the lib file.
I'd love to do it the proper way, so if anyone can clue me in on what I'm missing I'd be majorly thankful. But, thanks for the tip Kortalh. I think I'll do it your way in the meantime.[/i]
oops, I just answered to serengeor and forgot the original question.
You have to add 2 things - the library and the library path. So you are missing the path... (I've still no VS open - I think it's called linker or library path and should around the same place where you enter the library name itself).
You have to add 2 things - the library and the library path. So you are missing the path... (I've still no VS open - I think it's called linker or library path and should around the same place where you enter the library name itself).
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
Thanks CuteAlien. I finally figured it out. 
Project > Properties > Linker > Input is where I added irrlicht.lib
&
Project > Properties > Configuration Properties > VC++ Directories is where found the proper places to add a path to Irrlicht's include and lib folders.
When I ran my program, a dialogue box popped up saying something about being unable to find "irrlicht.dll". But I finally got the code to compile thanks to your help.
Project > Properties > Linker > Input is where I added irrlicht.lib
&
Project > Properties > Configuration Properties > VC++ Directories is where found the proper places to add a path to Irrlicht's include and lib folders.
When I ran my program, a dialogue box popped up saying something about being unable to find "irrlicht.dll". But I finally got the code to compile thanks to your help.
That is because irrlicht.dll isn't in the same folder that your .exe is in. You have to copy the .dll into your folder, or else compile Irrlicht as a statically linked library.Buffy Fan wrote:When I ran my program, a dialogue box popped up saying something about being unable to find "irrlicht.dll". But I finally got the code to compile thanks to your help.
If you link statically don't forget that you have to set the _IRR_STATIC_LIB_ define in your project (just add it in the defines section).
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
-
Radikalizm
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
You should really do some research on your compiler, the /MT switch just tells the compiler that it should use the static multithreaded version of the run-time library when compiling your application (don't mess with that unless you know what you're doing), this has nothing to do with statically linking irrlichtBuffy Fan wrote:I'll compile Irrlicht as a statically linked library.
Here's how I did it:
I went to Project > Properties > Configuration Properties > C/C++ > Code Generation > Runtime Library and set it to Multi-threaded (/MT)
I hope I did it right. I'm about to test it.
Thanks for all the help everyone.
You have to rebuild irrlicht with the _IRR_STATIC_LIB_ preprocessor flag set and link your application to to that rebuilt library with the same preprocessor flag set
Why so? What does it actually do when you set it. It worked fine for me without it, so I'd like to know what does it change.CuteAlien wrote:If you link statically don't forget that you have to set the _IRR_STATIC_LIB_ define in your project (just add it in the defines section).
Working on game: Marrbles (Currently stopped).
Google only gave me tutorials on how to build a statically linked library from scratch.
I tried to open irrlicht.dll with my IDE. But it failed and gave me a a pop-up saying "cannot enumerate resources in the executable". So fingers crossed that someone on the VS2010 forums will know how to open a dll file with my IDE so that I can turn it into a statically linked library.
Here's my thread:
http://social.msdn.microsoft.com/Forums ... fdffa5904e
I tried to open irrlicht.dll with my IDE. But it failed and gave me a a pop-up saying "cannot enumerate resources in the executable". So fingers crossed that someone on the VS2010 forums will know how to open a dll file with my IDE so that I can turn it into a statically linked library.
Here's my thread:
http://social.msdn.microsoft.com/Forums ... fdffa5904e
DLL stands for dynamic linked library - the whole idea behind them that DLL's are not linked statically when you create the .exe but loaded each time when you run the exe. To create a static library you have to recompile Irrlicht the way Radikalizm told you. There are targets for that already in Irrlicht.
But you don't need this. Just copy the dll into the right path. See here in which paths Windows does search for the DLL's when starting an executable: http://msdn.microsoft.com/en-us/library ... 85%29.aspx
So just copying the dll beside the .exe will already work.
But you don't need this. Just copy the dll into the right path. See here in which paths Windows does search for the DLL's when starting an executable: http://msdn.microsoft.com/en-us/library ... 85%29.aspx
So just copying the dll beside the .exe will already work.
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
