【VS/GUROBI】configure a new Gurobi C++ project with Microsoft Visual Studio 2015

来源:互联网 发布:淘宝 手机店 编辑:程序博客网 时间:2024/05/22 05:16

【精简版】

1.配置:release;x64

PS:VS菜单栏中也注意修改


2.C/C++:

常规-》附加包含目录:

C:\gurobi701\win64\include


代码生成-》运行库【默认】:

多线程调试 DLL (/MDd)


3.链接器:输入(注意与2中一致)

C:\gurobi701\win64\lib\gurobi70.lib;C:\gurobi701\win64\lib\gurobi_c++mdd2015.lib;%(AdditionalDependencies)


【官网原文】

It's easiest to modify one of the existing projects in the examples\build subdirectory. However, if you prefer to create a new project from scratch, here are the key steps:
  1. Under the File menu, select New > Project...; on the Installed Templates panel, select Other Languages > Visual C++ > Win32, then select Win32 Console Application. For illustration, let's call it gurobitest. Press the Finish button to close the Wizard.
  2. To add an existing source file:
    • Under Source Files below the project name in the Solution Explorer panel, right click on the initial source file that Visual Studio adds to the project (gurobitest.cpp in our example). Select Remove, then press Delete.
    • Right-click on the project name in the Solution Explorer panel, then select Add > Existing Item..., then choose your C++ source file.
  3. Right-click on the project name in the Solution Explorer panel, then select Properties.
  4. For 32-bit Gurobi libraries:
    • Set Platform to Win32 (if not already selected)
    • Under C/C++ / General / Additional Include Directories, add: c:\gurobi701\win32\include
    • Under Linker / General / Additional Library Directories, add: c:\gurobi701\win32\lib
  5. For 64-bit Gurobi libraries:
    • Set Platform to x64 (if not already selected)
    • Under C/C++ / General / Additional Include Directories, add: c:\gurobi701\win64\include
    • Under Linker / General / Additional Library Directories, add: c:\gurobi701\win64\lib
  6. Under C/C++ / Precompiled Headers / Precompiled Header, select Not Using Precompiled Headers
  7. Under Linker / Input / Additional Dependencies, add gurobi70.lib and gurobi_c++mdd2015.lib
0 0