It took me about 6 hours to figure out how to setup Gurobi on Eclipse C++ in Linux. I would keep getting the "Undefined Reference" error even after including the "include" and "lib" folders. I do not know if every following step is necessary, since I got it working through a lot of trial-and-error. Hope this helps anyone out who is stuck like me:
* Add the include folder (of Gurobi) in the "Includes" of GCC C++ Compiler (in C++ Build/Settings)
* In C++ Build/Settings/GCC C++ Linker/Libraries, add the libraries "gurobi70" and "aes70" (remember to omit the "lib" prefixes and ".so" extensions of the files while adding)
* In C++ Build/Settings/GCC C++ Linker/Libraries, add the path to the lib folder to "Library search path (-L)"
* In C++ Build/Settings/GCC C++ Linker/Miscellaneous/Other Objects, add the following files (including their paths): libgurobi_c++.a and libgurobi_g++5.2.a
After all these, if your program compiles but does not run (due to "Cannot open shared object file"), go to Run Configurations/Environment of your project,
and add the following:
Variable: LD_LIBRARY_PATH
Value: *full path to the lib folder of gurobi"
My LD_LIBRARY_PATH was already set to the lib folder through the OS, but I still had to add it to the project to make the project work.