Application size


I compile for example quaternionLatLongExample

but size of executable is 15.7 MB.

It’s normal for an application that take a sphere and rotate it ?

OF includes a variety of libraries which get statically linked so it’s not uncommon to have exes that size. you might check if it’s compiled debug or release, debug can contain more info in the binary (line numbers, etc).

I have compiled release con XCode.

Is possible compile wih dynamic link ?

I’m also interested in this topic.
Would like to know if there are any plans to get OF a bit more modular so that unused libraries doesn’t get linked.

I have done this in the past, for a project where I had trouble with quicktime, so I ended up with a version of OF that had no quicktime support in osx, by adding some preprocessor stuff that disabled it.

Out of this I ever wondered to have a more modular of setup, which would be mainly having some preprocessor defines to de/activate each of OF features. So if you just dont want of to have video or sound you just deactivate it by adding a preprocessor directive. This would also prove very useful for integrating OF to other development. I would be very interested in developing such thing if there is enough quorum. (I guess that this should be a different topic)

On the libraries side, now all is done by apothecary which happens to be a charm to work with. So, in order to get dynamic libs instead of static would mean just to modify the apothecary scripts and probably how your IDE is linking. Although this would be useful in the development machine it would be a pain use on other systems.


1 Like

Hi @roymacdonald, could you share an example of disabling libraries you don’t need?

I’ve been learning OpenGL (without OF) and noticed that the binaries are just about 300Kb. Of course there’s much less functionality available, but I do still draw, use shaders, mouse and keyboard input. Also compilation happens in less than one second, which is great for iterating. It would be nice if we could skip the modules we don’t need in a project, specially if we release an app it means that tons of people are going to use bandwidth to download code they won’t use, or?

Hi @hamoid,
I completely agree with you. It would be super useful to have this feature.
What I did in the past was to modify the OF core directly, adding #ifdefs to enable or disable different features.
It was a while ago, and it will not work with the newer releases of OF. Although there’s been a lot of improvement towards this goal, as there’s much less inter-dependencies between different classes. I think that it can be quite straight forwards to use classes such as ofMesh or ofCam with minimal dependencies.
I think that @arturo is the one that point you in a better direction.