Skip to main content

Cannot find license when using c++/cmake

Answered

Comments

1 comment

  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Zixun,

    The error comes from this line:

    GRBEnv env = GRBEnv(true);

    You are instructing Gurobi to create an empty environment (GRBEnv()) by specifying the optional parameter \(\texttt{empty=true}\). This is fine as long as you also start the environment via GRBEnv::start(). Using an empty env is intended to be used for specifying other license parameters to extend or replace what is written in the license file.

    For your license, it is sufficient to call the env constructor without the bool parameter to immediately start the environment. So, you just need to remove the \(\texttt{true}\) from the constructor to fix your code.

    Cheers,
    Matthias

    1

Please sign in to leave a comment.