Error when compiling mip1_c++ using VSCode on mac

Comments

4 comments

  • yingqiu zhang

    By the way, I can successfully build all examples in /Library/gurobi901/mac64/examples/build using the makefile.

    0
    Comment actions Permalink
  • Matthias Miltenberger

    Hi,

    You need to change "-l /Library/gurobi901/mac64/include" to "-I/Library/gurobi901/mac64/include". That's a capital "I" - to specify the include directory. The library is already loaded using "-L" and "-l".

    I would not call the binary EXE, by the way. This is usually only done on Windows.

    You might also want to check out CMake for easier compilation/building.

    Cheers,
    Matthias

    0
    Comment actions Permalink
  • yingqiu zhang

    Hi,

    Thanks! It is my typo.

    The link in your post is very useful! Thanks for sharing! My next step is to learn how to use CMake to build c++ project. I tried to use the template of CMakeLists from the link, but I have following errors: 

    CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

    Please set them or make sure they are set and tested correctly in the CMake files:

    GUROBI_CXX_LIBRARY

        linked by target "gurobi-template" in directory /Users/yingqiuzhang/Documents/TestVSC/helloworld

        linked by target "gurobi-template" in directory /Users/yingqiuzhang/Documents/TestVSC/helloworld

    GUROBI_INCLUDE_DIRS

       used as include directory in directory /Users/yingqiuzhang/Documents/TestVSC/helloworld

       used as include directory in directory /Users/yingqiuzhang/Documents/TestVSC/helloworld

       used as include directory in directory /Users/yingqiuzhang/Documents/TestVSC/helloworld

     

    -- Configuring incomplete, errors occurred!

    See also "/Users/yingqiuzhang/Documents/TestVSC/helloworld/build/CMakeFiles/CMakeOutput.log".

     

    I am new to this. I appreciate your help!

     

     

     

    0
    Comment actions Permalink
  • yingqiu zhang

    I solved above issues by adding GRUOBI_HOME environment variable. 

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk