メインコンテンツへスキップ

Cannot find license when using c++/cmake

回答済み

コメント

1件のコメント

  • Matthias Miltenberger
    • 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

サインインしてコメントを残してください。