Linker command failed
Compiling the mip1_c++ (saved as mip1.cpp here) example given in the Library using this:
g++ mip1.cpp -L /Library/gurobi811/mac64/lib/ -I /Library/gurobi811/mac64/include/ -lgurobi_c++ -lgurobi81 -m64
gives me the following error:
Undefined symbols for architecture x86_64:
"GRBEnv::GRBEnv()", referenced from:
_main in mip1-11be9d.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Working in a 10.14 os x mojave
most probably you are using a different C++ version. Gurobi ships with two static libraries, located in gurobi811/mac64/lib/libgurobi_g++4.2.a and gurobi811/mac64/lib/libgurobi_stdc++.a , you just need to change the symbolic link for gurobi811/mac64/lib/libgurobi_c++.a and try again.
If this fails, you can build a static library compatible with your particular compiler. The sources are provided in gurobi811/mac64/src/cpp/
Also, please try the sample Makefile in the examples/build directory.0
I've got the same problem and I'm totally new
could you please please help with more specific. I will appreciate it.
Please sign in to leave a comment.