Thread: [Dev-C++] DLL vs Lib linking
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Michael S. <mic...@nu...> - 2003-09-29 11:16:56
|
Hi, =20 I=B4ve seen libraries (for example wxWindows) that rely on other = libraries (e.g. user32.lib), means that they have unresolved symbols in it. When I want to link against wxWindows, I=B4ve to link with user32, too. Now, when I want to build a .dll instead of a .lib with the same code, = the linker tells me of many unresolved symbols (which are there), as opposed = to a .lib, where the linker isn=B4t even invoked (under MSVC .NET). =20 Am I understanding something wrong here, or how can I create a .dll = which relies on other libraries? =20 Thanks for your help =20 Michael Stather |
|
From: Neszt T. <ne...@ss...> - 2003-09-29 15:33:04
|
Hello! Could someone explain me why need any dll for my program? What I do: - #include <aaa.h> - link: -laaa (there is libaaa.a in the dev-c++ lib directory) Everything is ok. The project is compiled succesfully. But after starting, the program needs aaa.dll Am I right, that the header and/or cpp (aaa.h, aaa.cpp) defines all the callable functions, and the real functions is in the libaaa.a ?? If yes, why need the dll file? (for example if aaa=glut32, or aaa=fmod or ...) I simply don't want many dlls beside my program. I check all the regarding programs (Exebundle, Fusion, PEBundle, ...), but there are many problem with these. My aim is that all the functions what I need is should be in the builded exe file. So is there a soluton? Dev-c++ settings by any chance? Regards, Neszt Tibor |
|
From: Per W. <pw...@ia...> - 2003-09-29 16:23:33
|
Because libaaa.a is an import library, i.e. only contains a little stub code to fetch in the aaa.dll file where the real implementation is. The stub code will load the required DLL, locate all needed symbols in the DLL, and then initialize pointers to the different functions in the DLL. /Per W On Mon, 29 Sep 2003, Neszt Tibor wrote: > Hello! > > Could someone explain me why need any dll for my program? > > What I do: > - #include <aaa.h> > - link: -laaa (there is libaaa.a in the dev-c++ lib directory) > > Everything is ok. The project is compiled succesfully. But after starting, > the program needs aaa.dll > > Am I right, that the header and/or cpp (aaa.h, aaa.cpp) defines all the > callable functions, and the real functions is in the libaaa.a ?? > > If yes, why need the dll file? (for example if aaa=glut32, or aaa=fmod or ...) > > I simply don't want many dlls beside my program. > > I check all the regarding programs (Exebundle, Fusion, PEBundle, ...), but > there are many problem with these. > > My aim is that all the functions what I need is should be in the builded > exe file. > > So is there a soluton? Dev-c++ settings by any chance? > > > Regards, > > Neszt Tibor > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: <sol...@ya...> - 2003-09-29 16:42:12
|
The header has all the function and variable declarations the program needs, but the actual code is in the dll. That's just a dinamic link library: a file outside the exe that has the code which has to be executed, having the files for the exe included the header so they know there are those variables and functions somewhere - in the external dll. If you want have that code inside the exe, then you need use a static library, (those named libxxx.a). In your case your libxxx.a is what is known as import library, which includes the symbols of the dinamic library which have to be exported from the dll, but the code is still in the dll. The only solution is finding a static version of the dll. If it had been built by you, simply make the project an static link library instead a dinamic one (I mean, the project you used to build the dll). If it is a dll from some library you bought, then you'll have to check the documentation for if there is a static version or, if you got the source and built it, checking the makefiles for if there is some option so it builds as a static library. Hope this helps. P.D. - Sorry, I feel my english has been bad. Neszt Tibor wrote: >Hello! > >Could someone explain me why need any dll for my program? > >What I do: >- #include <aaa.h> >- link: -laaa (there is libaaa.a in the dev-c++ lib directory) > >Everything is ok. The project is compiled succesfully. But after starting, >the program needs aaa.dll > >Am I right, that the header and/or cpp (aaa.h, aaa.cpp) defines all the >callable functions, and the real functions is in the libaaa.a ?? > >If yes, why need the dll file? (for example if aaa=glut32, or aaa=fmod or ...) > >I simply don't want many dlls beside my program. > >I check all the regarding programs (Exebundle, Fusion, PEBundle, ...), but >there are many problem with these. > >My aim is that all the functions what I need is should be in the builded >exe file. > >So is there a soluton? Dev-c++ settings by any chance? > > >Regards, > >Neszt Tibor > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > |
|
From: Neszt T. <ne...@ss...> - 2003-09-30 08:16:57
|
Hello! Thank You for Your answer. That makes me clear many things. > The header has all the function and variable declarations the program > needs, but the actual code is in the dll. That's just a dinamic link > library: a file outside the exe that has the code which has to be > executed, having the files for the exe included the header so they know > there are those variables and functions somewhere - in the external dll. Ok, I see. > If you want have that code inside the exe, then you need use a static > library, (those named libxxx.a). In your case your libxxx.a is what is > known as import library, which includes the symbols of the dinamic > library which have to be exported from the dll, but the code is still in > the dll. So is that mean, that the static library and the import library is same regarding the names? How can I find out, if my libaaa.a is static or import library? (from the size?) > The only solution is finding a static version of the dll. If it had been > built by you, simply make the project an static link library instead a > dinamic one (I mean, the project you used to build the dll). If it is a No, it is not bulit by me. > dll from some library you bought, then you'll have to check the > documentation for if there is a static version or, if you got the source > and built it, checking the makefiles for if there is some option so it > builds as a static library. It is not secret, the libraries is the glut and the fmod. As far as I know, these are free and also the source code is available. Now, I tried to compile both of them with dev-c++ without result. (Even nor dynamic nor static library couldn't be create) Regards, Neszt Tibor |