Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Undefined symbols for architecture x86_64 #2392

Closed
hi-weiyuan opened this issue Apr 14, 2018 · 16 comments
Closed

Undefined symbols for architecture x86_64 #2392

hi-weiyuan opened this issue Apr 14, 2018 · 16 comments

Comments

@hi-weiyuan
Copy link

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?

@spoonincode
Copy link
Contributor

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?

@hi-weiyuan
Copy link
Author

hi-weiyuan commented Apr 14, 2018

@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

@pranksteess
Copy link

same error

@jgiszczak
Copy link
Contributor

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

@pacificcode pacificcode self-assigned this Apr 27, 2018
@pacificcode
Copy link
Contributor

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

@bilibiliChangKai
Copy link

same error

@bilibiliChangKai
Copy link

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

this is my anwser

@pacificcode
Copy link
Contributor

@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

@schabluk
Copy link

schabluk commented May 7, 2018

@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?

@kenorb
Copy link

kenorb commented May 7, 2018

Related: #1319

@schabluk
Copy link

schabluk commented May 7, 2018

In my case, reinstalling gettext helped.

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

@bilibiliChangKai
Copy link

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

@pacificcode
Copy link
Contributor

@schabluk #2028

@mounibec
Copy link

mounibec commented May 8, 2018

reinstalling gettext worked for me as well.

@anakornk
Copy link

anakornk commented Aug 4, 2018

@bilibiliChangKai thanks, reinstalling gettext worked for me.

@tpmccallum
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests