H3D.org Forum Index Installing and compiling
compiling self standing .exe or .dll | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| _mrbloom | Posted on: 2012/7/5 17:35 |
Not too shy to talk ![]() Joined: 2012/6/7 From: Posts: 12 |
compiling self standing .exe or .dll Hi all,
I am compiling an executable (actually a .dll loaded from Java) using the HAPI . I would like it to be self standing, that is a third user should be able to use it without necessarily installing the HAPI. Is that possible ? I am linking all static libraries (.lib) but if I remove the c:\H3D from my hard drive, it doesn't work any more and , via dependency walker, I see that some .dll are indeed needed. Maybe the .lib's of the HAPI library link, in turn, to the .dll (of the HAPI library) ? |
| Markus | Posted on: 2012/7/6 9:28 |
Webmaster ![]() ![]() Joined: 2006/3/27 From: SenseGraphics Posts: 1921 Online |
Re: compiling self standing .exe or .dll Hello,
Are you familiar with the concept of shared and static libraries? In windows a shared library is a dynamic library which is separated into a lib-file and a dll file. The lib file is needed for building and the dll file is needed when running the program. By default H3DAPI/HAPI/H3DUtil are built at shared libraries. We have done some tests with build H3DAPI/HAPI/H3DUtil as static libraries (that is, you only need the lib-file at build time and there is no dll) there was however some issues with getting part of H3DAPI to work properly in this case, HAPI might however work (not guaranteed). If you really do not want to distribute External dlls you need to do the following: 1. Change HAPI/H3DUtil to be built as static libraries. 2. Build all external libraries that you need to use as static libraries if the authors of those libraries do not offer them like that already (that is, fetch the source code for those libraries and build them yourself with your C++ compiler). 3. Hope that it is possible to compile HAPI as static without breaking anything. Which basically means test, test and test your program. If compile HAPI as static library does not work because some functionality gets broken then compile HAPI as shared library and all the other ones as static. In the CMake GUI you can change which external libraries are used for linking and where to find headers. |
| _mrbloom | Posted on: 2012/7/6 13:52 |
Not too shy to talk ![]() Joined: 2012/6/7 From: Posts: 12 |
Re: compiling self standing .exe or .dll ah, I am familiar with the concept of static and dynamic linking but didn't know that, in windows, shared .dll's come together with a .lib
Your answer was helpful many thanks |
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |



