MS Visual Studio 2013 Professional + Gurobi

1,127 views
Skip to first unread message

Floris Weerbrouck

unread,
Nov 10, 2013, 7:11:20 AM11/10/13
to gur...@googlegroups.com
Hi, i'm new to Gurobi. I need the software because of my thesis. I first used code::blocks as a C++ editor but since Gurobi is not compatible with code::blocks I now switched to MS Visual Studio 2013.

I'm following the quick start guide and wanted to test the mip1_c++.cpp example but I failed to build the file correctly. I saw another topic in this group with a link to the FAQ and how to start a new project with MS Visual Studio, however, it still fails to compile.

This is the faq, I updated a few file names since the version I use is gurobi 5.6 32-bit (since Visual Studio is also 32-bit).

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. Under C/C++ / Precompiled Headers / Precompiled Header, select Not Using Precompiled Headers.
  5. For 32-bit Gurobi libraries:
    • Under C/C++ / General / Additional Include Directories, add:c:\gurobi560\win32\include
    • Under Linker / General / Additional Library Directories, add: c:\gurobi550\win32\lib
  6. Under Linker / Input / Additional Dependencies, add gurobi56.lib andgurobi_c++mdd2010.li
    b

These are the errors I get from Visual Studio. Does anyone know a solution for this problem? It would be a very big help.

gurobi_c++mdd2010.lib(LinExpr.2010.omdd) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in main.obj
1>gurobi_c++mdd2010.lib(TempConstr.2010.omdd) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in main.obj
1>gurobi_c++mdd2010.lib(Env.2010.omdd) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in main.obj
1>gurobi_c++mdd2010.lib(Model.2010.omdd) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in main.obj
1>gurobi_c++mdd2010.lib(Var.2010.omdd) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in main.obj
1>gurobi_c++mdd2010.lib(QuadExpr.2010.omdd) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in main.obj
1>gurobi_c++mdd2010.lib(Exception.2010.omdd) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in main.obj
1>gurobi_c++mdd2010.lib(Constr.2010.omdd) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in main.obj
1>gurobi_c++mdd2010.lib(SOS.2010.omdd) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in main.obj
1>gurobi_c++mdd2010.lib(QConstr.2010.omdd) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in main.obj
1>gurobi_c++mdd2010.lib(Callback.2010.omdd) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in main.obj
1>gurobi_c++mdd2010.lib(Column.2010.omdd) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in main.obj
1>gurobi_c++mdd2010.lib(SOS.2010.omdd) : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)" (__imp_?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z) referenced in function "public: int __thiscall GRBSOS::get(enum GRB_IntAttr)const " (?get@GRBSOS@@QBEHW4GRB_IntAttr@@@Z)
1>C:\Users\Floris\documents\visual studio 2013\Projects\Gurobi Test\Debug\Gurobi Test.exe : fatal error LNK1120: 1 unresolved externals

Thank you in advance,

Floris Weerbrouck


Greg Glockner

unread,
Nov 10, 2013, 9:36:33 AM11/10/13
to gur...@googlegroups.com
Visual Studio 2013 isn't released yet:

https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_2013

I'm sure it will be supported soon after the release, but we don't support unreleased products. The list of compatible platforms can be found in:

http://www.gurobi.com/products/gurobi-optimizer/platforms

Floris Weerbrouck

unread,
Nov 10, 2013, 11:02:44 AM11/10/13
to gur...@googlegroups.com
Well I downloaded the software officially via Microsoft. Since I am a student, I could get the latest version for free. Furthermore, the link you provide clearly states:

"The final release of Visual Studio 2013 became available for download on October 17, 2013"

So the software is released, although to be fair, it is only available since a month. Do you have any idea how long it would take to support the latest version? Or should I look to downgrade?

Thank you for your quick response!

fbahr

unread,
Nov 10, 2013, 1:03:15 PM11/10/13
to gur...@googlegroups.com
@Greg: MSVS2013 final has been released on October 17, 2013 (as stated in the Wikipedia article you shared).

@Floris: _MSC_VER is a preprocessor variable / predefined macro, probably checked in gurobi56.lib and/or gurobi_c++mdd2010.lib to ensure you're compiling your application on a "supported" platform [value '1800' means: you use VS2013, value '1600' says: but we expect you to use VS2010].

Regards,
fbahr

Greg Glockner

unread,
Nov 10, 2013, 1:08:46 PM11/10/13
to gur...@googlegroups.com
> @Greg: MSVS2013 final has been released on October 17, 2013 (as stated in the Wikipedia article you shared).

No, this is a preview release. The official release date is Tuesday:

http://events.visualstudio.com

Gurobi hasn't announced an official date for Visual Studio 2013 support, but I'm sure it will be soon.

Ahmed Mhadhbi

unread,
Feb 18, 2014, 4:21:51 AM2/18/14
to gur...@googlegroups.com
When gurobi will support visual studio 2013?

Greg Glockner

unread,
Feb 18, 2014, 9:53:12 AM2/18/14
to gur...@googlegroups.com
> When gurobi will support visual studio 2013?

It's under development but we don't have a release date yet.

Reply all
Reply to author
Forward
0 new messages