I’m a beginner in C++, so my doubt may seem basic, but I’m struggling to solve this problem.
I’m trying to compile the example simple-real-number.cpp by myself using
g++ simple-real-number.cpp command, but I get the following error:
src/pke/examples/simple-real-numbers.cpp:38:10: fatal error: openfhe.h: No such file or directory
Why the compilation is not finding the header file? Is this an installation problem, or something else? Can someone help me?
Please read the CMake build instructions located here:
To be more concise, there is no need to invoke g++ directly. Here are the steps that you might use in a terminal under Linux to build the library, and the example you are interested in:
clone the openfhe repository
cd into the repository’s local copy directory
cmake [any cmake options you want] ..
Without any cmake options, the example you are interested in is built by default. The binary can be found in:
[repo local copy]/build/bin/examples/simple-real-numbers
You can modify the code in-tree, and re-run make -j in the build directory if you make changes.
I hope this gets you past your issue. If not, please feel free to continue this thread with any questions.
Thanks a lot!
I could modify the file and re-run make-j to recompile the example!
Glad to hear it!
Let us know if you have any other issues.
Same here, I’m a beginner in C++. I’m on Windows 10, and followed the installation guide. Everything went smoothly, until the
make command, where I get the following error:
[ 0%] Built target third-party
Consolidate compiler generated dependencies of target coreobj
[ 1%] Building CXX object src/core/CMakeFiles/coreobj.dir/lib/lattice/hal/default/dcrtpoly-impl.cpp.obj
In file included from C:/msys64/home/Pro7ech/openfhe-development/src/core/include/math/discretegaussiangenerator.h:77,
C:/msys64/home/Pro7ech/openfhe-development/src/core/include/math/distributiongenerator.h: In static member function 'static lbcrypto::PRNG& lbcrypto::PseudoRandomNumberGenerator::GetPRNG()':
C:/msys64/home/Pro7ech/openfhe-development/src/core/include/math/distributiongenerator.h:132:26: error: pointer 'mem' used after 'void free(void*)' [-Werror=use-after-free]
132 | uint32_t counter = reinterpret_cast<long long>(mem); // NOLINT
C:/msys64/home/Pro7ech/openfhe-development/src/core/include/math/distributiongenerator.h:131:21: note: call to 'void free(void*)' here
131 | free(mem);
cc1plus.exe: all warnings being treated as errors
make: *** [src/core/CMakeFiles/coreobj.dir/build.make:197: src/core/CMakeFiles/coreobj.dir/lib/lattice/hal/default/dcrtpoly-impl.cpp.obj] Error 1
make: *** [CMakeFiles/Makefile2:551: src/core/CMakeFiles/coreobj.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Any help would be appreciated
Hey there, @Pro7ech !
Would you mind opening up a new thread? Mostly because your error seems to be different from what this user was running into