-1

First of all, feel free to answer as if I was 5 yo :)

I've written a Hello World c++ program, intended to include the cryptography library fhe.h, which I have installed previously (make check works fine). I have a folder, let's call it "dir", including "HelloWorld.cpp" and a subfolder named HElib, which has the file "fhe.h" in the directory HElib/src/fhe.h.

My question is somewhat stupid, but how do I compile this c++ file ?

I tried to cd to /dir, then "g++ HelloWorld.cpp" but it doesn't find fhe.h. I've also tried "g++ HelloWorld.cpp HElib/src/fhe.h", it still doesn't find fhe.h.

How can I tell the compiler the exact placing of this file ? I would not like to put my HelloWorld.cpp file into HElib, nor getting fhe.h out of HElib... Thanks and sorry for such a basic question !

T-B

Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
  • HElib includes an install.txt that should have answered this question: https://github.com/shaih/HElib/blob/master/INSTALL.txt – Alexander Jan 15 '17 at 19:35

1 Answers1

2

You need to include directory with fhe.h. Something like this:

g++ -IHElib/src HelloWorld.cpp

Please read this

Roman Zaitsev
  • 1,328
  • 5
  • 20
  • 28