Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

Static compiling

Static compiling
chris 2005/06/22 09:43
Hello everyone,

please allow me one stupid question. Most recently I nearly finished a bigger project using OCC 5.0, including its Browser etc. Now when I do dynamic linking, it needs a lot of libraries (.so files) being included calling make.
How about makeing a static compilat ? The point is, that my software shall be installed on another computer, where most of the libraries simply just do not exist. But my softweare should run on it.

Does anyone know if static compiling is the solution therefore (I know static compiling is dumb !), any good and quick alternative ?

How to do staic compiling...just put --static before every gcc call in my makefile ?

Best regards and thanks in advance.

Chris
yuwenhui 2008/10/11 04:51
hi,

Have you solved the problem? I also need to link the static libs of occ to generate my single executable file. would you mind tell me how to do it?
yuwenhui 2008/10/11 04:51
hi,

Have you solved the problem? I also need to link the static libs of occ to generate my single executable file. would you mind tell me how to do it?
gianni 2008/10/11 07:56
I use static libraries with Visual Studio 2005 and everything works fine. To create static libraries you have to define the preprocessor symbol HAVE_NO_DLL and of course change the Configuration Type (in the project defaults) to static library.

Thomas 2008/10/13 08:35
I did it with Visual studio 2009.
I suggest you :
1 - Create a new configuration instead of overriding "Release" and define HAVE_NO_DLL for it.
2- In doing so check the output folders for LIB, intermediate and Obj files, even in the C++ tab since these are explicitly overridden even for Obj files.
3- In debug mode, continue linking to DEBUG version of the libraries. If you want , build a "debug static" configuration, but I don't think it is worth. Using static libraries in debug leads to crashes in the runtime.
4- When adding the static libraries to the project, remember that you have to include many more Libs than in the DLL version, since dependencies of the lib files aren't automatically added.

I have seen a drastic space usage reduction in using static libs.
 
 
Latest news
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map