01-27-2010, 06:41 PM
Hi!
I've been doing some studying on dll's for about a fortnight now. I have been understanding their concept well enough but have had alot of porblems understanding how to make them. Thanks to the tutorials on this site and the web in general I am not too bad with them now. I think I could probably make a small demo dll test project if I wanted.
My issue is this however:
I am trying to load a demo program for a graphics engine called OGRE. I am building from source, and I am enjoying learning how to. There are no pre-compiled things available for my IDE's compiler (Dev C++ IDE and MingW compiler) but this doesn't trouble me as I want to learn to build from source anyway. I can get my cpp file to compile without any errors in the code. I did have some issues with header files but I have told my IDE where to look for them now so that's ok. The problem is though the linker is complaining. The reason is there are loads and loads of c++ files in OGRE where all the main classes are defined and when my project tries to compile it says it cannot find any of them.
I do not want to have to attach every required OGRE c++ file to my project to get it to run. I am told this is where I need a DLL file. If I can make a DLL file which contains all the required OGRE programs then I only have to include that DLL file in my project - please correct me if I am wrong. So with all that explained I have the following questions:
1) By telling my IDE which C++ header files to include, does this mean a copy of all those header files is copied to my project when I compile it or do they stay at their location in memory and just get accessed when needed at run-time (would this cause a hard drive hit?) or when the .exe file is initiated?
2) Can I make a DLL file without having to explicity copy and paste all the required (several hundred) OGRE class defines into it. Is there some way I can just use a DLL as a sort of reference, just as a 'go between' between my main c++ file and the required OGRE c++ files with the classes in them?
3) Do I have to use a DLL in the fashion where it is accessed at run time or can I use one to make a static library? There will only ever be one instance of our demo application running so do we really need a DLL file to be shared and accessed at run time? Is there some perfomance benefit from using a DLL in this way?
I haven't really got a clue, but then I've never had it properly explained to me. Mostly it's just half truths with lots of information missing and people assuming I know stuff I've never been taught
This site seems different though, it appears to have quite a different attitude so perhaps this is the right place for a noob
Thanks muchly to anyone who can help us
I've been doing some studying on dll's for about a fortnight now. I have been understanding their concept well enough but have had alot of porblems understanding how to make them. Thanks to the tutorials on this site and the web in general I am not too bad with them now. I think I could probably make a small demo dll test project if I wanted.
My issue is this however:
I am trying to load a demo program for a graphics engine called OGRE. I am building from source, and I am enjoying learning how to. There are no pre-compiled things available for my IDE's compiler (Dev C++ IDE and MingW compiler) but this doesn't trouble me as I want to learn to build from source anyway. I can get my cpp file to compile without any errors in the code. I did have some issues with header files but I have told my IDE where to look for them now so that's ok. The problem is though the linker is complaining. The reason is there are loads and loads of c++ files in OGRE where all the main classes are defined and when my project tries to compile it says it cannot find any of them.
I do not want to have to attach every required OGRE c++ file to my project to get it to run. I am told this is where I need a DLL file. If I can make a DLL file which contains all the required OGRE programs then I only have to include that DLL file in my project - please correct me if I am wrong. So with all that explained I have the following questions:
1) By telling my IDE which C++ header files to include, does this mean a copy of all those header files is copied to my project when I compile it or do they stay at their location in memory and just get accessed when needed at run-time (would this cause a hard drive hit?) or when the .exe file is initiated?
2) Can I make a DLL file without having to explicity copy and paste all the required (several hundred) OGRE class defines into it. Is there some way I can just use a DLL as a sort of reference, just as a 'go between' between my main c++ file and the required OGRE c++ files with the classes in them?
3) Do I have to use a DLL in the fashion where it is accessed at run time or can I use one to make a static library? There will only ever be one instance of our demo application running so do we really need a DLL file to be shared and accessed at run time? Is there some perfomance benefit from using a DLL in this way?
I haven't really got a clue, but then I've never had it properly explained to me. Mostly it's just half truths with lots of information missing and people assuming I know stuff I've never been taught

This site seems different though, it appears to have quite a different attitude so perhaps this is the right place for a noob

Thanks muchly to anyone who can help us
