eos icon indicating copy to clipboard operation
eos copied to clipboard

Error while Linking CXX executable eosio-applesedemo

Open wudongyang opened this issue 8 years ago • 18 comments

$./eosio-build.sh darwin

[ 88%] Linking CXX executable eosio-applesedemo
ld: framework not found security
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [programs/eosio-applesedemo/eosio-applesedemo] Error 1
make[1]: *** [programs/eosio-applesedemo/CMakeFiles/eosio-applesedemo.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 89%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/chain_config.cpp.o
[ 89%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/merkle.cpp.o
[ 89%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/name.cpp.o
[ 89%] Linking CXX static library libhttp_plugin.a
[ 89%] Built target http_plugin
[ 89%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/transaction.cpp.o
[ 89%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/block.cpp.o
[ 89%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/wast_to_wasm.cpp.o
[ 90%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/wasm_interface.cpp.o
[ 90%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/wasm_eosio_constraints.cpp.o
[ 90%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/apply_context.cpp.o
[ 90%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/rate_limiting.cpp.o
/Users/wdy/dev/src/gitoschina/eos/eos/libraries/chain/wasm_interface.cpp:223:20: warning: 
      TODO: restore checktime injection? [-W#warnings]
                  #warning TODO: restore checktime injection?
                   ^
/Users/wdy/dev/src/gitoschina/eos/eos/libraries/chain/wasm_interface.cpp:414:8: warning: 
      field 'context' will be initialized after field 'code' [-Wreorder]
      :context(intrinsics_accessor::get_context(wasm).context), code(int...
       ^
/Users/wdy/dev/src/gitoschina/eos/eos/libraries/chain/wasm_interface.cpp:414:65: warning: 
      field 'code' will be initialized after field 'sbrk_bytes' [-Wreorder]
      :context(intrinsics_accessor::get_context(wasm).context), code(int...
                                                                ^
[ 90%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/fork_database.cpp.o
[ 90%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/get_config.cpp.o
[ 90%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/block_log.cpp.o
[ 91%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/asset.cpp.o
[ 91%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/global_property_object.cpp.o
[ 91%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/chain_controller.cpp.o
3 warnings generated.
[ 91%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/contracts/eosio_contract.cpp.o
[ 91%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/contracts/chain_initializer.cpp.o
[ 91%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/contracts/genesis_state.cpp.o
/Users/wdy/dev/src/gitoschina/eos/eos/libraries/chain/chain_controller.cpp:598:27: warning: 
      unused variable 'signing_producer' [-Wunused-variable]
   const producer_object& signing_producer = validate_block_header(skip...
                          ^
/Users/wdy/dev/src/gitoschina/eos/eos/libraries/chain/chain_controller.cpp:1576:11: warning: 
      TODO: restore bandwidth checks [-W#warnings]
         #warning TODO: restore bandwidth checks
          ^
/Users/wdy/dev/src/gitoschina/eos/eos/libraries/chain/chain_controller.cpp:1573:18: warning: 
      unused variable 'virtual_max_uacts' [-Wunused-variable]
      uint128_t  virtual_max_uacts  = dgpo.virtual_act_bandwidth * confi...
                 ^
/Users/wdy/dev/src/gitoschina/eos/eos/libraries/chain/chain_controller.cpp:1570:18: warning: 
      unused variable 'used_ubytes' [-Wunused-variable]
      uint128_t  used_ubytes        = buo.bytes.value;
                 ^
/Users/wdy/dev/src/gitoschina/eos/eos/libraries/chain/chain_controller.cpp:1571:18: warning: 
      unused variable 'used_uacts' [-Wunused-variable]
      uint128_t  used_uacts         = buo.acts.value;
                 ^
/Users/wdy/dev/src/gitoschina/eos/eos/libraries/chain/chain_controller.cpp:1572:18: warning: 
      unused variable 'virtual_max_ubytes' [-Wunused-variable]
      uint128_t  virtual_max_ubytes = dgpo.virtual_net_bandwidth * confi...
                 ^
/Users/wdy/dev/src/gitoschina/eos/eos/libraries/chain/contracts/eosio_contract.cpp:85:16: warning: 
      unused variable 'new_account' [-Wunused-variable]
   const auto& new_account = db.create<account_object>([&create, &contex...
               ^
/Users/wdy/dev/src/gitoschina/eos/eos/libraries/chain/contracts/eosio_contract.cpp:127:8: warning: 
      TODO: update setcode message to include the hash, then validate it in
      validate [-W#warnings]
      #warning TODO: update setcode message to include the hash, then va...
       ^
[ 92%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/contracts/abi_serializer.cpp.o
/Users/wdy/dev/src/gitoschina/eos/eos/libraries/chain/contracts/eosio_contract.cpp:42:13: warning: 
      unused function 'modify_eosio_balance' [-Wunused-function]
static void modify_eosio_balance( apply_context& context, const account_...
            ^
[ 92%] Building CXX object libraries/chain/CMakeFiles/eosio_chain.dir/transaction_metadata.cpp.o
3 warnings generated.
6 warnings generated.
[ 92%] Linking CXX static library libeosio_chain.a
[ 92%] Built target eosio_chain
make: *** [all] Error 2

wudongyang avatar Feb 11 '18 01:02 wudongyang

It goes well after changed the branch to dawn-2.x.

wudongyang avatar Feb 11 '18 08:02 wudongyang

What version of Xcode do you have installed?

I would be curious to see the make VERBOSE=1 output on a failed compile.

spoonincode avatar Feb 12 '18 03:02 spoonincode

Version 9.2 (9C40b)

wudongyang avatar Feb 12 '18 05:02 wudongyang

Also seeing this is at the same spot when building on Darwin (pulled master right before I wrote this comment)

[ 91%] Linking CXX static library libeosio_chain.a cd /Users/everettwizr/EOS/eos/build/libraries/chain && /usr/local/Cellar/cmake/3.10.1/bin/cmake -P CMakeFiles/eosio_chain.dir/cmake_clean_target.cmake cd /Users/everettwizr/EOS/eos/build/libraries/chain && /usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/eosio_chain.dir/link.txt --verbose=0 [ 91%] Built target eosio_chain make: *** [all] Error 2

NewETown avatar Feb 17 '18 22:02 NewETown

Can you provide output of make VERBOSE=1 please

spoonincode avatar Feb 17 '18 23:02 spoonincode

@spoonincode Build processes aren't my strong point, pretty sure I'm not running the command correctly because the output was the same. What target am I supposed to use when I run make VERBOSE=1?

NewETown avatar Feb 18 '18 00:02 NewETown

Actually can you try building on the switch-darwin-openssl-dir branch? Go to the root of your eos directory and,

$ git fetch
$ git checkout switch-darwin-openssl-dir

Then do the build as you did before (via eosio_build.sh I assume). Thanks

spoonincode avatar Feb 18 '18 02:02 spoonincode

@spoonincode Similar but made it a bit further using ./eosio_build.sh Darwin full

[ 95%] Building CXX object tests/CMakeFiles/chain_test.dir/common/main.cpp.o cd /Users/everettwizr/EOS/eos/build/tests && /usr/local/bin/clang++ -I/Users/everettwizr/EOS/eos/build/contracts -I/Users/everettwizr/EOS/eos/build/tests/tests/contracts -I/Users/everettwizr/EOS/eos/tests/wasm_tests -I/Users/everettwizr/EOS/eos/libraries/testing/include -I/Users/everettwizr/EOS/eos/build/libraries/testing/include -I/Users/everettwizr/EOS/eos/libraries/testing/../wasm-jit/Include -I/Users/everettwizr/EOS/eos/libraries/chain/include -I/Users/everettwizr/EOS/eos/build/libraries/chain/include -I/Users/everettwizr/EOS/eos/libraries/chain/../wasm-jit/Include -I/Users/everettwizr/EOS/eos/libraries/utilities/include -I/Users/everettwizr/EOS/eos/libraries/utilities/../wasm-jit/Include -I/Users/everettwizr/EOS/eos/libraries/fc/include -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/Users/everettwizr/EOS/eos/libraries/fc/vendor/websocketpp -I/Users/everettwizr/EOS/eos/libraries/chainbase/include -I/Users/everettwizr/EOS/eos/libraries/wasm-jit/Source/Runtime/../../../chain/include -I/Users/everettwizr/EOS/eos/libraries/egenesis/include -I/Users/everettwizr/EOS/eos/plugins/chain_plugin/include -I/Users/everettwizr/EOS/eos/libraries/appbase/include -I/Users/everettwizr/EOS/eos/libraries/abi_generator/include -std=c++14 -Wall -Wno-deprecated-declarations -o CMakeFiles/chain_test.dir/common/main.cpp.o -c /Users/everettwizr/EOS/eos/tests/common/main.cpp [ 95%] Linking CXX executable chain_test cd /Users/everettwizr/EOS/eos/build/tests && /usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/chain_test.dir/link.txt --verbose=0 [ 95%] Built target chain_test make: *** [all] Error 2

>>>>>>>>>>>>>>>>>>>> MAKE building EOSIO has exited with the above error.

NewETown avatar Feb 18 '18 03:02 NewETown

Oops, sorry, looks like we need to regenerate the cmake cache files for this fix to take affect and there appears to not be a "clean" command in eosio_build.sh that would do this for us.

From the root of your eosio directory you will need to rm -r build Then try the eosio_build.sh command again.

spoonincode avatar Feb 18 '18 03:02 spoonincode

@spoonincode >>>>>>>>>>>>>>>>>>>> EOSIO has been successfully installed. Much appreciated :)

NewETown avatar Feb 18 '18 04:02 NewETown

It doesn't fit for me!

I tried the last commit on master and the branch "switch-darwin-openssl-dir", but have same error.

[ 80%] Built target IR /Applications/Xcode.app/Contents/Developer/usr/bin/make -f libraries/wasm-jit/Source/Runtime/CMakeFiles/Runtime.dir/build.make libraries/wasm-jit/Source/Runtime/CMakeFiles/Runtime.dir/depend ld: framework not found security clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [programs/eosio-applesedemo/eosio-applesedemo] Error 1 make[1]: *** [programs/eosio-applesedemo/CMakeFiles/eosio-applesedemo.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... cd /Volumes/WDH2/eos/eos/build && /usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_depends "Unix Makefiles" /Volumes/WDH2/eos/eos /Volumes/WDH2/eos/eos/libraries/wasm-jit/Source/Runtime /Volumes/WDH2/eos/eos/build /Volumes/WDH2/eos/eos/build/libraries/wasm-jit/Source/Runtime /Volumes/WDH2/eos/eos/build/libraries/wasm-jit/Source/Runtime/CMakeFiles/Runtime.dir/DependInfo.cmake --color= /Applications/Xcode.app/Contents/Developer/usr/bin/make -f libraries/wasm-jit/Source/Runtime/CMakeFiles/Runtime.dir/build.make libraries/wasm-jit/Source/Runtime/CMakeFiles/Runtime.dir/build make[2]: Nothing to be done for libraries/wasm-jit/Source/Runtime/CMakeFiles/Runtime.dir/build'. [ 82%] Built target Runtime make: *** [all] Error 2

>>>>>>>>>>>>>>>>>>>> MAKE building EOSIO has exited with the above error.

`

I checked the path of openssl on my MAC, it is "/usr/local/opt/openssl", eosio_build.sh also changed to this path.

Build successful with "git checkout DAWN-2018-02-14"

wudongyang avatar Feb 24 '18 01:02 wudongyang

@spoonincode

set VERBOSE = 1

[ 83%] Built target WASM
[ 83%] Linking CXX executable eosio-applesedemo
cd /Volumes/WDH2/eos/eos/build/programs/eosio-applesedemo && /usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/eosio-applesedemo.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f libraries/wasm-jit/Source/Emscripten/CMakeFiles/Emscripten.dir/build.make libraries/wasm-jit/Source/Emscripten/CMakeFiles/Emscripten.dir/depend
cd /Volumes/WDH2/eos/eos/build && /usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_depends "Unix Makefiles" /Volumes/WDH2/eos/eos /Volumes/WDH2/eos/eos/libraries/wasm-jit/Source/Emscripten /Volumes/WDH2/eos/eos/build /Volumes/WDH2/eos/eos/build/libraries/wasm-jit/Source/Emscripten /Volumes/WDH2/eos/eos/build/libraries/wasm-jit/Source/Emscripten/CMakeFiles/Emscripten.dir/DependInfo.cmake --color=
/usr/local/bin/clang++   -std=c++14 -Wall -Wno-deprecated-declarations -Wl,-search_paths_first -Wl,-headerpad_max_install_names -framework security -framework corefoundation CMakeFiles/eosio-applesedemo.dir/main.cpp.o CMakeFiles/eosio-applesedemo.dir/r1_signature_compactor.cpp.o  -o eosio-applesedemo ../../libraries/fc/libfc.a -L/usr/local/lib /usr/local/lib/libboost_thread-mt.a /usr/local/lib/libboost_date_time-mt.a /usr/local/lib/libboost_filesystem-mt.a /usr/local/lib/libboost_system-mt.a /usr/local/lib/libboost_program_options-mt.a /usr/local/lib/libboost_signals-mt.a /usr/local/lib/libboost_serialization-mt.a /usr/local/lib/libboost_chrono-mt.a /usr/local/lib/libboost_unit_test_framework-mt.a /usr/local/lib/libboost_context-mt.a /usr/local/lib/libboost_locale-mt.a /usr/local/lib/libboost_iostreams-mt.a /usr/lib/libpthread.dylib /usr/local/opt/openssl/lib/libssl.a /usr/local/opt/openssl/lib/libcrypto.a /usr/lib/libz.dylib /usr/lib/libbz2.dylib /usr/local/lib/libsecp256k1.a /usr/local/lib/libgmp.a 
ld: framework not found security
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f libraries/wasm-jit/Source/Emscripten/CMakeFiles/Emscripten.dir/build.make libraries/wasm-jit/Source/Emscripten/CMakeFiles/Emscripten.dir/build
make[2]: *** [programs/eosio-applesedemo/eosio-applesedemo] Error 1
make[1]: *** [programs/eosio-applesedemo/CMakeFiles/eosio-applesedemo.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: Nothing to be done for `libraries/wasm-jit/Source/Emscripten/CMakeFiles/Emscripten.dir/build'.
[ 83%] Built target Emscripten
make: *** [all] Error 2

	>>>>>>>>>>>>>>>>>>>> MAKE building EOSIO has exited with the above error.

wudongyang avatar Feb 24 '18 01:02 wudongyang

It looks like you may need to do a clean build. From the root of your eosio directory you will need to run:

rm -rf build/

Then try the eosio_build.sh command again.

On Feb 23, 2018, at 5:15 PM, wudongyang [email protected] wrote:

It doesn't fit for me!

I tried the last commit on master and the branch "switch-darwin-openssl-dir".

[ 80%] Built target IR /Applications/Xcode.app/Contents/Developer/usr/bin/make -f libraries/wasm-jit/Source/Runtime/CMakeFiles/Runtime.dir/build.make libraries/wasm-jit/Source/Runtime/CMakeFiles/Runtime.dir/depend ld: framework not found security clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [programs/eosio-applesedemo/eosio-applesedemo] Error 1 make[1]: *** [programs/eosio-applesedemo/CMakeFiles/eosio-applesedemo.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... cd /Volumes/WDH2/eos/eos/build && /usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_depends "Unix Makefiles" /Volumes/WDH2/eos/eos /Volumes/WDH2/eos/eos/libraries/wasm-jit/Source/Runtime /Volumes/WDH2/eos/eos/build /Volumes/WDH2/eos/eos/build/libraries/wasm-jit/Source/Runtime /Volumes/WDH2/eos/eos/build/libraries/wasm-jit/Source/Runtime/CMakeFiles/Runtime.dir/DependInfo.cmake --color= /Applications/Xcode.app/Contents/Developer/usr/bin/make -f libraries/wasm-jit/Source/Runtime/CMakeFiles/Runtime.dir/build.make libraries/wasm-jit/Source/Runtime/CMakeFiles/Runtime.dir/build make[2]: Nothing to be done forlibraries/wasm-jit/Source/Runtime/CMakeFiles/Runtime.dir/build'. [ 82%] Built target Runtime make: *** [all] Error 2

MAKE building EOSIO has exited with the above error. `

I checked the path of openssl on my MAC, it is "/usr/local/opt/openssl", eosio_build.sh also changed to this path.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EOSIO/eos/issues/1361#issuecomment-368183549, or mute the thread https://github.com/notifications/unsubscribe-auth/AA4DMJu48LX_hpxgFXWsuv5oQWIm2UYdks5tX2KfgaJpZM4SBKPR.

pacificcode avatar Feb 24 '18 01:02 pacificcode

I had deleted the build directory, but have same error.

wudongyang avatar Feb 24 '18 01:02 wudongyang

For some reason cmake is not adding the -isysroot option to the command line to link here. No good idea why. For comparison, here's how it looks for me (notice the isysroot line)

/usr/local/bin/clang++   -std=c++14 -Wall -Wno-deprecated-declarations -g -isysroot /Applications/92/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -framework security -framework corefoundation CMakeFiles/eosio-applesedemo.dir/main.cpp.o CMakeFiles/eosio-applesedemo.dir/r1_signature_compactor.cpp.o  -o eosio-applesedemo ../../libraries/fc/libfc_debug.a -L/usr/local/lib /usr/local/lib/libboost_thread-mt.a /usr/local/lib/libboost_date_time-mt.a /usr/local/lib/libboost_filesystem-mt.a /usr/local/lib/libboost_system-mt.a /usr/local/lib/libboost_program_options-mt.a /usr/local/lib/libboost_signals-mt.a /usr/local/lib/libboost_serialization-mt.a /usr/local/lib/libboost_chrono-mt.a /usr/local/lib/libboost_unit_test_framework-mt.a /usr/local/lib/libboost_context-mt.a /usr/local/lib/libboost_locale-mt.a /usr/local/lib/libboost_iostreams-mt.a /usr/lib/libpthread.dylib /usr/local/opt/openssl/lib/libssl.a /usr/local/opt/openssl/lib/libcrypto.a /usr/lib/libz.dylib /usr/lib/libbz2.dylib /usr/local/lib/libsecp256k1.a /usr/local/lib/libgmp.a

My only recommendation to try, is to reinstall cmake via brew. Do an uninstall and install of it. I've seen a little spooky behavior from cmake when upgrade my macos from 10.12 to 10.13 because brew will actually download a different cmake binary depending on the version and that different version seems to look for a different MacOSX.sdk directory. It's a long shot, but give it a try.

spoonincode avatar Mar 09 '18 15:03 spoonincode

Do you still encounter this issue in the latest version of eosio?

andriantolie avatar Jun 29 '18 08:06 andriantolie

Original issue reporter unresponsive since February. Issue is not widespread and is apparently installation specific. If the problem occurs in release 1.2.4 or later, feel free to file a new issue.

jgiszczak avatar Sep 11 '18 21:09 jgiszczak

I am using Oracle Vitual Box - Ubuntu OS to install EOSIO software. When I tried to build eosio.cdt from source. My terminal got stuck during the below point. "Linking CXX executable simple_tests.wasm". Someone suggested me to comment "include(modules/TestsExternalProject.txt)" line in the file "CMakeLists.txt". After this, built successfully and installed successfully. But when I tried to execute hello smart contract, my terminal again got stuck and it doesn't generate .wasm file of the smart contract. Screenshot (4)

sugalivijaychari avatar Sep 27 '19 06:09 sugalivijaychari