Building CPLEX Callable Library Applications on Win32 Platforms

Building a CPLEX application using MS Visual C++ Integrated Development Environment, or the MS Visual C++ command line compiler are explained here.

Microsoft Visual C++ IDE

To make a CPLEX Callable Library application using Visual C++, first create or open a project in the Visual C++ Integrated Development Environment (IDE). Project files are provided for each of the examples found in the directory examples\msvc6\<libformat> and examples\msvc6\<libformat>. For details on the build process, refer to the information file msvc.html, which is found in the top of the installed CPLEX directory structure.

Microsoft Visual C++ Command Line Compiler

If the Visual C++ command line compiler is used outside of the IDE, the command should resemble the following example. The example command assumes that the file cplex81.lib is in the current directory with the source file lpex1.c, and that the line in the source file "#include <ilcplex/cplex.h>" correctly points to the location of the include file or else has been modified to do so (or that the directories containing these files have been added to the environment variables LIB and INCLUDE respectively).

  cl lpex1.c cplex81.lib

This command will create the executable file lpex1.exe.

Using Dynamic Loading

Some projects require more precise control over the loading and unloading of DLLs. For information on loading and unloading DLLs without using static linking, please refer to the compiler documentation or to a book such as Advanced Windows by Jeffrey Richter from Microsoft Press. If this is not a requirement, the static link implementations mentioned above are easier to use.


Previous Page: Building CPLEX Callable Library Applications on UNIX Platforms   Return to Top Next Page: Building Applications that Use the CPLEX Parallel Optimizers