User forums > General (but related to Code::Blocks)

Gurobi in Code::Blocks

(1/2) > >>

Lobric:
Hi !
I’ve tried to include "gurobi_c++.h" in but unluckily failed.
Can anyone tell me which part did I do wrong?





I did this both in the compiler setting and the project build options.

Result:


I’ll appreciate it very much.

Miguel Gimenez:
This is a linker problem, gurobi_c++.h was included successfully. Post a full rebuild log in code tags, see http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

sodev:
Looking at the names of the link libraries it looks like you added pretty much every Visual Studio compiled variant that was supplied, that won't work. You need to use the one library that matches your compiler. Most probably you are using some GCC compiler, it looks like all the libraries in your list are for Visual Studio, the last one might be a pure C library while the others might be C++ libraries, or it might be a GCC one. But this is just pure crystal ball science.

The proper solution is to figure out which compiler you use and if the library vendor offers a library for that compiler and what it's name is.

Lobric:
Thanks for your replies.

Sorry, I just added all the libraries and failed.
I didn't know it doesn't provide support for MinGW.
It seems like the reason why it's always undefined.

This is from Gurobi's website.


Is that means I can't use Gurobi with Code Block ?

Miguel Gimenez:
Code::Blocks is an IDE, not a compiler, and you can change the compiler it uses; MinGW is just a convenient and free option.

If the library you want to use only supports Visual Studio you can install this M$ crapware (https://visualstudio.microsoft.com/es/vs/community/) and select it as compiler in your C::B project or just use their IDE.

Navigation

[0] Message Index

[#] Next page

Go to full version