Usage of C++ Edition Static Libraries
The C++ Editions of /n software's toolkits ship with static libraries that can be used in your application. (Note: For the C++ Editions for Linux and macOS, you'll need to request the obfuscated source code from us, and you'll need to have an active Red Carpet Subscription in order to do so.)
Before you can declare or use the static components in your application they must be initialized. Each component in the static libraries has an initialization method and a destruction method. To initialize the static component you will want to use the StaticInit methods similar to the following:
// The method name will be in the pattern "[ProductNamespace]_[ComponentName]_StaticInit".
// For example, this is the method you'd use for the Atom component from IPWorks:
IPWorks_Atom_StaticInit(0);
When the application is finished with the static components they will also need to be destroyed to ensure any static resources are freed up. This can be done by using the StaticDestroy methods similar to the following:
// The method name will be in the pattern "[ProductNamespace]_[ComponentName]_StaticDestroy".
// For example, this is the method you'd use for the Atom component from IPWorks:
IPWorks_Atom_StaticDestroy();
It is important to ensure that these methods are called only once for each component. Multiple calls to the above methods may cause unexpected behavior.
Common errors when using C++ Static Libraries
- "[10093] Winsock not loaded yet (WSANOTINITIALISED)"
- "[10022] Invalid argument"
This error means that the Static Library is not initialized at all. Please see example codes above to initialize the Static Library
This error means that the Static Library is initialized after the component is created. Please make sure you initialize the Static Library before creating the component
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.