herumi / mcl

a portable and fast pairing-based cryptography library
BSD 3-Clause "New" or "Revised" License
450 stars 152 forks source link

Linker error while compiling on Mac OS X #68

Closed adambudziak closed 4 years ago

adambudziak commented 4 years ago

When running with make in the root dir the linker returns the following error:

c++ -o lib/libmclbn384_256.dylib obj/bn_c384_256.o -shared -L/usr/local/opt/openssl/lib -L/usr/local/opt/gmp/lib -lgmp -lgmpxx -lcrypto -m64  -lmcl -L./lib
Undefined symbols for architecture x86_64:
  "mcl::fp::Op::init(mcl::VintT<mcl::vint::Buffer<unsigned long long> > const&, unsigned long, int, mcl::fp::Mode, unsigned long)", referenced from:
      mcl::FpT<mcl::bn::local::FpTag, 384ul>::init(bool*, int, mcl::VintT<mcl::vint::Buffer<unsigned long long> > const&, mcl::fp::Mode) in bn_c384_256.o
      mcl::FpT<mcl::bn::local::FrTag, 256ul>::init(bool*, int, mcl::VintT<mcl::vint::Buffer<unsigned long long> > const&, mcl::fp::Mode) in bn_c384_256.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/libmclbn384_256.dylib] Error 1
herumi commented 4 years ago

The error shows that bn_c384_256.o is built with MCL_USE_GMP=0, so could you try make clean and make?

adambudziak commented 4 years ago

Och, I feel so dumb. Cleaning works (I tried cleaning inside build dir for CMake and it didn't work.) Thx.