Hi all, I meet a issue about GRBModel in a C++ header file. Let me use TSP to illustrate my problem.
I am writing a TSP model in main.cpp file.
And a cutting plane struct in CutGeneration.h header file.
To find a cutting plane, I need to solve an optimization problem with Gurobi( I know for TSP we can write algorithm instead of Gurobi model, but my problem really needs Gurobi ).
To avoid reading gurobi license too many times, I try to use the same gurobi enviroment from main.cpp file to create models.
But in that case I need to access that GRBEnv variable from main.cpp file, so I try to declare a gurobi model without setting enviroment first. Then define a initilization function in struc. Then pass GRBEnv to the struc through initilization function.
But error happens in attached figure. I am not an expert of C++..., so can you help me on this?
Because in my understanding, I can declare a GurobiModel( which is essentially a class object ), then construct details latter(using passed GRBEnv). What is wrong with my approach?
Please sign in to leave a comment.