eos icon indicating copy to clipboard operation
eos copied to clipboard

Undefined symbols for architecture x86_64

Open hi-weiyuan opened this issue 8 years ago • 16 comments

I follow getting start, but there are something wrong with me. Could you please help me? When I use "./eosio_build.sh",there are 2 errors Undefined symbols for architecture x86_64: "typeinfo for llvm::Instruction", referenced from: typeinfo for llvm::SelectInst in libRuntime.a(LLVMEmitIR.cpp.o) "typeinfo for llvm::MemoryBuffer", referenced from: typeinfo for llvm::ObjectMemoryBuffer in libRuntime.a(LLVMJIT.cpp.o) "typeinfo for llvm::JITSymbolResolver", referenced from: typeinfo for LLVMJIT::NullResolver in libRuntime.a(LLVMJIT.cpp.o) "typeinfo for llvm::RTDyldMemoryManager", referenced from: typeinfo for LLVMJIT::UnitMemoryManager in libRuntime.a(LLVMJIT.cpp.o) "typeinfo for llvm::CmpInst", referenced from: typeinfo for llvm::FCmpInst in libRuntime.a(LLVMEmitIR.cpp.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[2]: *** [libraries/wasm-jit/Source/Programs/Test] Error 1 make[1]: *** [libraries/wasm-jit/Source/Programs/CMakeFiles/Test.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... What should I do?

hi-weiyuan avatar Apr 14 '18 01:04 hi-weiyuan

This is usually an indicator that the LLVM libraries you are linking with were not compiled with RTTI. What platform are you using? Did you use eosio_build.sh?

spoonincode avatar Apr 14 '18 01:04 spoonincode

@spoonincode My platform is macOS Sierra 10.12.6; I had used eosio_build.sh and then error occured. What should I do next? Thank you

hi-weiyuan avatar Apr 14 '18 02:04 hi-weiyuan

same error

pranksteess avatar Apr 24 '18 13:04 pranksteess

There have been numerous fixes to the MacOS build script this week. Please update your clone with git pull and retry the build.

jgiszczak avatar Apr 27 '18 22:04 jgiszczak

@WildBlackBear @pranksteess run these commands and paste the output here: which llvm-config llvm-config --has-rtti --version

pacificcode avatar Apr 27 '18 22:04 pacificcode

same error

bilibiliChangKai avatar May 05 '18 06:05 bilibiliChangKai

@pacificcode $ which llvm-config /usr/local/opt/llvm/bin/llvm-config $ llvm-config --has-rtti --version YES 6.0.0

this is my anwser

bilibiliChangKai avatar May 05 '18 06:05 bilibiliChangKai

@WildBlackBear @pranksteess @bilibiliChangKai EOS.IO needs to compile against llvm 4.x. Run the following and you should be good.

brew remove --force llvm brew install llvm@4 brew unlink llvm@4 && brew link --force llvm@4 cd /path/to/eos rm -rf build/ git pull git submodule update --init --recursive ./eosio_build.sh

pacificcode avatar May 07 '18 14:05 pacificcode

@pacificcode

That didn't help, still have the same issue:

ld: warning: ignoring file /usr/local/lib/libintl.dylib, missing required architecture x86_64 in file /usr/local/lib/libintl.dylib (2 slices)
Undefined symbols for architecture x86_64:
  "_libintl_bindtextdomain", referenced from:
      _main in main.cpp.o
  "_libintl_gettext", referenced from:
      eosio::client::localize::localized_with_variant(char const*, fc::variant_object const&) in main.cpp.o
      eosio::client::localize::localized_with_variant(char const*, fc::variant_object const&) in help_text.cpp.o
  "_libintl_setlocale", referenced from:
      _main in main.cpp.o
  "_libintl_textdomain", referenced from:
      _main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [programs/cleos/cleos] Error 1
make[1]: *** [programs/cleos/CMakeFiles/cleos.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

It seems that mine error is related to gettext. Which version of gettext are you using?

schabluk avatar May 07 '18 17:05 schabluk

Related: #1319

kenorb avatar May 07 '18 17:05 kenorb

In my case, reinstalling gettext helped.

brew reinstall gettext
brew unlink gettext && brew link gettext --force --overwrite

schabluk avatar May 07 '18 18:05 schabluk

@pacificcode Yes, you are right. Thank you for your help!

bilibiliChangKai avatar May 08 '18 02:05 bilibiliChangKai

@schabluk https://github.com/EOSIO/eos/issues/2028

pacificcode avatar May 08 '18 14:05 pacificcode

reinstalling gettext worked for me as well.

mounibec avatar May 08 '18 17:05 mounibec

@bilibiliChangKai thanks, reinstalling gettext worked for me.

anakornk avatar Aug 04 '18 16:08 anakornk

Thanks @schabluk gettext worked for me as well.

If anyone is interested, this is what I ran to install EOS mainnet on macOS https://gist.github.com/tpmccallum/45eb7d34a5406508419fa7e676909006

tpmccallum avatar Aug 10 '18 06:08 tpmccallum