Unix and Mac OSX: Exclude unused components during compilation

Shows how to reduce the size of your compiled application by including only components you need.

Date Entered: 04/30/2012    Last Updated: 04/30/2012

When using the Unix or Mac OSX editions of our products the overall size of your application can be reduced by including only the components you need during compilation. This will exclude any unused components.

Unix Edition Instructions

With the Unix edition of the toolkit you can set the _IPWORKS_MINSIZE_ compiler define along with a define for each component you wish to include, for instance _INCLUDE_IPWORKS_HTTP_. Any component not included with a define will be excluded.

You can manually modify the source code of the product (ipworks.cpp) and define these values. For instance:

Note that this must be done in the product's source code, not in your source code. Alternatively you can define this when compiling the source code from the command line:
g++ -o ipworks.o -c -D _IPWORKS_MINSIZE_ -D _INCLUDE_IPWORKS_HTTP_ ipworks.cpp

Mac OSX Instructions

With the Mac OSX edition you can specify the required values in your project settings from XCode. Navigate to Build Settings and find the Preprocessor Macros line. Add the follow space separated valued:


We appreciate your feedback.  If you have any questions, comments, or suggestions about this entry please contact our support team at kb@nsoftware.com.