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

Cannot find license when using c++/cmake

回答済み

コメント

2件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support.
  • 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

投稿コメントは受け付けていません。