Using CodeMeter API
General Information
There are two different ways to access the CodeMeter API in C/C++. You can either link dynamically, which uses the dynamic library of the currently installed runtime package. Or you link statically, which includes the functionality of the CodeMeter library in your application.
Linking method |
Description |
|---|---|
Dynamic Linking |
Windows: The only thing to do to use the CodeMeter Core API via dynamic linking is to include CodeMeter.h in your source code. Linux: Pass the library shortcut "-lwibucmlin" for 32-bit or "-lwibucmlin64" for 64-bit to your linker options. macOS: To include CodeMeter.h extend your compiler flags (CXXFLAGS) by "-I/Applications/WIBU-SYSTEMS\ Devkit/CodeMeter/include". For the linker add the option "-framework WibuCmMacX". |
Static Linking |
For static linking the following is required: •You need the CodeMeter static libraries for your compiler / linker. •Inclusion of CodeMeter.h in source code. •Definition of the constant_CODEMETER_API_STATIC_LIB before CodeMeter.h inclusion. o#define _CODEMETER_API_STATIC_LIB should be used before #include "CodeMeter.h". oUsing the compiler option /D_CODEMETER_API_STATIC_LIB. •For the different operating systems: •On Windows the linker automatically uses the static library. •Linux: Pass the library "/usr/lib/libwibucm.a" for 32-bit and "/usr/lib/libwibucm.a" for 64-bit to your linker options. •macOS: Add the option "/Applications/WIBU-SYSTEMS\ Devkit/CodeMeter/lib/libwibucmmac.a -framework Carbon -framework Security" to the linker, "-framework SystemConfiguration", and "-framework CFNetwork". •Calling CmStaticLibOnInit(): On static linking you must call CmStaticLibOnInit() before using any other CodeMeter function. CmStaticLibOnInit() perfoms some initial essentials, e.g. on Windows it starts CodeMeter License Server, if the service is not running. CmStaticLibOnExit() must be called at the end of the program for a cleanup of activities. You may call CmStaticLibOnInit() as often as you need it. If you create a dynamic library, do not call CmStaticLibOnInit() in the constructor of your library. e.g. DllMain for Windows. |
Notes
•If you configured static linking of your compilation, please remember that on compiling a debug variant the CodeMeter API will be included dynamically! Only the release variant is compiled statically, if the _CODEMETER_API_STATIC_LIB constant is set.
•Windows: To prevent the automatic inclusion of any CodeMeter library (static or dynamic one) by the linker, the _CODEMETER_NODEFLIB constant can be set before including CodeMeter.h. In this case the desired library has to be passed to the linker manually.
This API is delivered suited for any operating system platform. Support for .NET starts with Framework 1.1.
For installing CodeMeter Core API for Python, please note the following:
Prerequisites
•Standard-Installation of CodeMeter SDK Version 7.30 on Windows, Linux, macOS
•Installed Python, at least Version 3
Installing
You find the necessary files as part of a file in the wheel format (*.whl). It is located at:
Operating system |
Path information |
Windows |
C:\Program Files (x86)\CodeMeter\DevKit\python\codemeter_api-[Versionsinformation]-py3-none-any.whl |
Linux |
/usr/share/CodeMeter/DevKit/codemeter_api-[Versionsinformation]-py3-none-any.whl |
macOS |
/Applications/WIBU-SYSTEMS Devkit/CodeMeter/Python/codemeter_api-[Versionsinformation]-py3-none-any.whl |
The package can be installed as usual using pip the package installer for Python:
$ pip install [path-to-wheel-package]/codemeter_api-version information]-py3-none-any.whl
For more information see the separate CodeMeter Developer Guide documentation.
|
Linux users are recommended to download the CodeMeter Developer Guide from the download section at https://www.wibu.com/support/manuals-guides.html. |
This API is delivered suited for any operating system platform. All functions have been tested with Python 3.8.3. Python 2 is not supported.