In this tutorial I will describe how to configure Microsoft Visual Studio Express to use IBM CPLEX with Concert technology in a C++ project. This tutorial assumes you already have CPLEX installed. If this is not the case, follow the How to Download and Install a full version of CPLEX. If you’re looking for how to use CPLEX with Apple Xcode, follow the How to configure IBM CPLEX with Apple Xcode.
First, open MS Visual Studio and start a new C++ console application. You might want to see How to Install Visual Studio and Create a C++ project.
When your project is created, right click “Project” and select “Properties”.
Go through Configuration Properties – C/C++ – General. You will want to edit the “Additional Include Directories”.
Here you need to add the full path to the include directories of CPLEX and CONCERT. Under my Windows system, these look like the following image.
Then, still under the C/C++ properties, navigate to the Preprocessor menu and edit it to look like the following:
Now, edit the Linker – General – Additional Library Directories.
And add the folders corresponding to your system and platform. In my case it is Visual Studio 2012 64 bits.
You also need to edit the Linker – Input – Additional Dependencies
And add the following information (once again, I have installed CPLEX 12.6.1, the latest version as of writing).
The procedure is the same if you have other versions of CPLEX or if you use Visual Studio 2010 or 2013. These are all supported by CPLEX 12.6.1.
Now you can import an example from CPLEX or code your own model/algorithm. Enjoy!
You might want to see How to Install MS Visual Studio and How to Download and Install a full version of IBM CPLEX.
This was useful? Buy me a cup of coffee to help me keep this website running!