I am using GUROBI Optimizer in my C++ code to solve a mathematical optimization problem.
I include the header "gurobi_c++.h", and to be able to use this I do:
- Configuration properties -> C/C++ -> General -> Additional Include directories: I add directory of Gurobi
- Configuration properties -> Linker -> General -> Additional Library dependencies: I add library directory of Gurobi
- Configuration properties -> Linker -> Input -> Additional dependencies: I add Gurobi's relevant .lib files
And, under the 'debug' mode, everything runs perfectly. However, 'release' mode gives a lot of 'LNK2001' errors. Each error looks like:
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol __imp__invalid_parameter project_name ...\gurobi_c++mdd2019.lib(Callback.2019.omdd) 1
I don't know why only 'Release' mode has this issue. I compared the settings between 'Debug' and 'Release' modes, there is no difference!
However, maybe the reason is related to this: In Configuration Properties -> Debugging -> Environment, I add to the environment path as:
PATH=$(PATH);$...\gurobi900\win64\lib
So maybe it is because I don't have such an environment in release? I don't know how to fix this.