[Coin-discuss] Some small syntactic changes for Windows COIN
librik at panix.com
librik at panix.com
Wed Aug 9 18:51:23 EDT 2006
In order to be part of the C interface on Windows, functions need to be
declared with the COINLINKAGE decoration. Almost all of them are, but
there were a few oversights.
Here, then, are some necessary edits to CBC and CLP headers and interfaces.
(1) In the files Clp_C_Interface.cpp and Clp_C_Interface.h, the function
maximumIterations is missing its COINLINKAGE decoration. Change:
COINLIBAPI int maximumIterations(Clp_Simplex * model)
to:
COINLIBAPI int COINLINKAGE maximumIterations(Clp_Simplex * model)
in both the .cpp and the .h file.
(2) In the files Cbc_C_Interface.cpp and Cbc_C_Interface.h, several function
declarations & definitions are missing their COINLINKAGE decorations. Change:
COINLIBAPI int Cbc_maximumIterations(Cbc_Model * model)
COINLIBAPI int Cbc_maxNumNode(Cbc_Model * model)
COINLIBAPI int Cbc_maxNumNode(Cbc_Model * model)
to:
COINLIBAPI int COINLINKAGE Cbc_maximumIterations(Cbc_Model * model)
COINLIBAPI int COINLINKAGE Cbc_maxNumNode(Cbc_Model * model)
COINLIBAPI int COINLINKAGE Cbc_maxNumNode(Cbc_Model * model)
in both the .cpp and the .h file.
(3) In Coin_C_Defines.h (which has multiple copies in both the include and
Coin/include directory), the line:
# define COINLIBAPI __declspec(dllexport) extern "C"
must be rewritten as:
# define COINLIBAPI extern "C" __declspec(dllexport)
since newer versions of the Microsoft compiler impose a required order on
__declspec(dllexport). This change is backwards-compatible.
These three changes are necessary to keep the Windows DLL build working on
the latest compiler.
Sincerely yours,
- David Librik
librik at panix.com
More information about the Coin-discuss
mailing list