snucrypto / HEAAN

Other
353 stars 94 forks source link

Compile time error when "make all" in HEAAN/run #9

Closed haochenuw closed 6 years ago

haochenuw commented 6 years ago

/tmp/cchIEFuo.o: In function NTL::RR::~RR()': run.cpp:(.text._ZN3NTL2RRD2Ev[_ZN3NTL2RRD5Ev]+0x4): undefined reference to_ntl_gfree(_ntl_gbigint_body)' /tmp/cchIEFuo.o: In function _GLOBAL__sub_I_main': run.cpp:(.text.startup+0x171): undefined reference toNTL::ComputePi(NTL::RR&)' run.cpp:(.text.startup+0x197): undefined reference to `_ntl_gfree(_ntl_gbigint_body)' run.cpp:(.text.startup+0x1d2): undefined reference to `_ntl_gfree(_ntl_gbigint_body*)' collect2: error: ld returned 1 exit status makefile:8: recipe for target 'HEAAN' failed make: *** [HEAAN] Error 1

KyoohyungHan commented 6 years ago

Thanks for reporting the bug :)

I fixed that part.

The problem is from the order of command, just you need to use

"g++ run.cpp -o HEAAN -L/usr/local/lib ../lib/libHEAAN.a -lntl -lgmp -lm -std=c++11 -O2 -I/../src -pthread".