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
Any help?
-
Hi Sulagna,
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/
Best,
Daniel
0 -
Also, please try the sample Makefile in the examples/build directory.
0 -
Dear Greg,
I've got the same problem and I'm totally new
could you please please help with more specific. I will appreciate it.
Regards
0
サインインしてコメントを残してください。
コメント
3件のコメント