Hello everyone,
In order to learn how to build my own project, I am trying to build “boolean.cpp” as my “demo-simple-example.cpp” first, however it came out with some error.
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text+0xae5): undefined reference to `intnat::NativeVectorT<intnat::NativeIntegerT<unsigned long long> >::~NativeVectorT()'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text+0xb01): undefined reference to `intnat::NativeVectorT<intnat::NativeIntegerT<unsigned long long> >::~NativeVectorT()'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text+0xb20): undefined reference to `intnat::NativeVectorT<intnat::NativeIntegerT<unsigned long long> >::~NativeVectorT()'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text+0xb49): undefined reference to `intnat::NativeVectorT<intnat::NativeIntegerT<unsigned long long> >::~NativeVectorT()'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text+0xb6b): undefined reference to `intnat::NativeVectorT<intnat::NativeIntegerT<unsigned long long> >::~NativeVectorT()'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text+0xb91): more undefined references to `intnat::NativeVectorT<intnat::NativeIntegerT<unsigned long long> >::~NativeVectorT()' follow
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text.startup+0xaa): undefined reference to `lbcrypto::BinFHEContext::GenerateBinFHEContext(lbcrypto::BINFHE_PARAMSET, lbcrypto::BINFHE_METHOD)'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text.startup+0xb7): undefined reference to `lbcrypto::BinFHEContext::KeyGen() const'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text.startup+0x10b): undefined reference to `lbcrypto::BinFHEContext::BTKeyGen(std::shared_ptr<lbcrypto::LWEPrivateKeyImpl const>)'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text.startup+0x1a8): undefined reference to `lbcrypto::BinFHEContext::Encrypt(std::shared_ptr<lbcrypto::LWEPrivateKeyImpl const>, long long const&, lbcrypto::BINFH
E_OUTPUT, unsigned long long, intnat::NativeIntegerT<unsigned long long>) const'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text.startup+0x218): undefined reference to `lbcrypto::BinFHEContext::Encrypt(std::shared_ptr<lbcrypto::LWEPrivateKeyImpl const>, long long const&, lbcrypto::BINFH
E_OUTPUT, unsigned long long, intnat::NativeIntegerT<unsigned long long>) const'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text.startup+0x282): undefined reference to `lbcrypto::BinFHEContext::EvalBinGate(lbcrypto::BINGATE, std::shared_ptr<lbcrypto::LWECiphertextImpl const>, std::share
d_ptr<lbcrypto::LWECiphertextImpl const>) const'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text.startup+0x2d6): undefined reference to `lbcrypto::BinFHEContext::EvalNOT(std::shared_ptr<lbcrypto::LWECiphertextImpl const>) const'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text.startup+0x346): undefined reference to `lbcrypto::BinFHEContext::EvalBinGate(lbcrypto::BINGATE, std::shared_ptr<lbcrypto::LWECiphertextImpl const>, std::share
d_ptr<lbcrypto::LWECiphertextImpl const>) const'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text.startup+0x3c6): undefined reference to `lbcrypto::BinFHEContext::EvalBinGate(lbcrypto::BINGATE, std::shared_ptr<lbcrypto::LWECiphertextImpl const>, std::share
d_ptr<lbcrypto::LWECiphertextImpl const>) const'
D:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/myboolean.dir/objects.a(myboolean.cpp.obj):myboolean.cp
p:(.text.startup+0x446): undefined reference to `lbcrypto::BinFHEContext::Decrypt(std::shared_ptr<lbcrypto::LWEPrivateKeyImpl const>, std::shared_ptr<lbcrypto::LWECiph
ertextImpl const>, long long*, unsigned long long) const'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/myboolean.dir/build.make:101: myboolean.exe] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/myboolean.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
The error seems like it doesn’t know the function defined in namespace lbcrypto, so I am wondering if it cannot find the “binfhecontext.cpp” or did I miss something?
(I had completed “make install” and copied the CMakeLists.User.txt (modified) and PreLoad.cmake into my boolean folder.)
Here are the hierarchy of my folder and thanks for the reading.
my_example
----boolean
--------build
--------CMakeLists.txt
--------myboolean.cpp
--------PreLoad.cmake