0

I want to write the following include in my .cpp file :

#include <lpsolve/lp_lib.h>

But I really don't know how to install the library ... The official project sourceforge page gives a .tar.gz with the following files :

liblpsolve55.a   lp_Hash.h  lp_matrix.h  lp_SOS.h  lp_utils.h   liblpsolve55.so  lp_lib.h   lp_mipbb.h   lp_types.h

I tried to put the .so file in /usr/lib but I don't know how to link it with the lp_lib.h file ... I don't understand anything about external librairies in C++... Please help

Guillaume Leseur
  • 140
  • 1
  • 1
  • 15
  • Your makefile (or whatever you are using) needs to know about the location of the lpsolve/lp_lib.h file i.e. where you have put lpsolve - are you using a makefile? CMake?... – doctorlove Nov 25 '16 at 15:42
  • Actually I have a lpsolve dir in /home/myname/Documents with all the listed above files. And it's just a single .cpp file so I compile with g++ ... No makefile – Guillaume Leseur Nov 25 '16 at 15:50
  • See http://stackoverflow.com/questions/6141147/how-do-i-include-a-path-to-libraries-in-g You need to use -I and -L as well – doctorlove Nov 25 '16 at 15:57

0 Answers0