How to run a .cpp file with Gecode Framework on Linux?

165 Views Asked by At

I use Ubuntu 18.04 and try to compile the example 'money.cpp' file that Gecode brings. I downloaded (gecode-release-5.1.0.tar.gz) and extract it. Then to install Gecode I do the following steps:

(1) ./configure (2) make

I get satisfactory installation.

Then I try to compile money.cpp, like this: $g++ money.cpp

and I get the following error:

fatal error: gecode / driver.hh: No such file or directory   #include            ^ ~~~~~~~~~~~~~~~~~

I know the problem is that it does not recognize the libraries, but how can I make my .cpp or compile phase recognize them?

regards! Alberto

1

There are 1 best solutions below

2
Luis Dipak On BEST ANSWER

You need to call g++ with the -I flag so that g++ knows where to look for the include files:

g++ -I<dir> money.cpp

<dir> is the source code directory for the files (the one with structure as seen on GitHub):

https://github.com/Gecode/gecode

See Compiling with g++:

https://courses.cs.washington.edu/courses/cse373/99au/unix/g++.html