This article assumes that you have installed a Gurobi 12.0 release on your Windows computer using the MSI installer. It's easiest to modify one of the existing projects in the examples\build subdirectory of your Gurobi installation. However, if you prefer to create a new project from scratch, these are the key steps:
Create the project:
- Under the File menu, select New > Project...
- Under Installed > Visual C++ > Windows Desktop select Windows Console Application. For this article, let us call it gurobitest.
- Press the Finish button to close the Wizard.
Add an existing source file:
- In the Solution Explorer, under the Project name (gurobitest) > Source Files, right-click on gurobitest.cpp. Select Remove, then press Delete.
- Right-click on the project name (gurobitest) in the Solution Explorer panel, then select Add > Existing Item..., then choose your C++ source file.
Configure the project:
- Right-click on the project name in the Solution Explorer panel, then select Properties.
- Set Platform to x64
- Set Configuration to All Configurations
- Under Debugging set Environment to PATH=$(PATH);$(GUROBI_HOME)\lib
- Under C/C++ > General > Additional Include Directories, add: $(GUROBI_HOME)\include
- Under C/C++ > Precompiled Headers > Precompiled Header, select Not Using Precompiled Headers
- Under Linker > General > Additional Library Directories, add: $(GUROBI_HOME)\lib
- Set Configuration to Debug
- Under Linker > Input > Additional Dependencies, add gurobi120.lib; gurobi_c++mdd2017.lib
- Set Configuration to Release
- Under Linker > Input > Additional Dependencies, add gurobi120.lib; gurobi_c++md2017.lib
When building your project, make sure the current target in the Visual Studio toolbar is x64 (it usually defaults to x86).
Comments
0 comments
Article is closed for comments.