Closed fferri closed 4 years ago
not found for architecture x86_64 clang: error
use -v to see invocation
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.14.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -o BlueCloudClientTests -search_paths_first -headerpad_max_install_names CMakeFiles/BlueCloudClientTests.dir/tests.cpp.o CMakeFiles/BlueCloudClientTests.dir/client.cpp.o CMakeFiles/BlueCloudClientTests.dir/data.cpp.o CMakeFiles/BlueCloudClientTests.dir/BlueCloudClientTests_autogen/mocs_compilation.cpp.o -v /usr/local/opt/qt/lib/QtNetworkAuth.framework/QtNetworkAuth /usr/local/opt/qt/lib/QtWebEngineWidgets.framework/QtWebEngineWidgets /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libboost_system.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libboost_thread.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libboost_chrono.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libboost_filesystem.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libboost_log.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libboost_date_time.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libboost_atomic.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libboost_log_setup.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libboost_regex.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libssl.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libcrypto.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libcpprest.a /Users/me/Dev/vcpkg/installed/x64-osx/lib/libxml2.a /Users/me/Dev/vcpkg/installed/x64-osx/lib/liblzma.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libz.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libazurestorage.a /usr/local/opt/qt/lib/QtWebEngineCore.framework/QtWebEngineCore /usr/local/opt/qt/lib/QtWebChannel.framework/QtWebChannel /usr/local/opt/qt/lib/QtPositioning.framework/QtPositioning /usr/local/opt/qt/lib/QtQuick.framework/QtQuick /usr/local/opt/qt/lib/QtQml.framework/QtQml /usr/local/opt/qt/lib/QtNetwork.framework/QtNetwork /usr/local/opt/qt/lib/QtPrintSupport.framework/QtPrintSupport /usr/local/opt/qt/lib/QtWidgets.framework/QtWidgets /usr/local/opt/qt/lib/QtGui.framework/QtGui /usr/local/opt/qt/lib/QtCore.framework/QtCore /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libz.a -framework CoreFoundation -framework Security /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libssl.a /Users/me/Dev/vcpkg/installed/x64-osx/debug/lib/libcrypto.a -ldl -liconv -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/lib/darwin/libclang_rt.osx.a
@(#)PROGRAM:ld PROJECT:ld64-409.12
BUILD 17:47:51 Sep 25 2018
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em arm64e arm64_32
Library search paths:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib
Framework search paths:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/
Undefined symbols for architecture x86_64:
"_llvm_gcda_emit_arcs", referenced from:
___llvm_gcov_writeout in libazurestorage.a(cloud_blob.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_common.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_block_blob.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(operation_context.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_blob_container.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_storage_account.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_blob_client.cpp.o)
...
"_llvm_gcda_emit_function", referenced from:
___llvm_gcov_writeout in libazurestorage.a(cloud_blob.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_common.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_block_blob.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(operation_context.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_blob_container.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_storage_account.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_blob_client.cpp.o)
...
"_llvm_gcda_end_file", referenced from:
___llvm_gcov_writeout in libazurestorage.a(cloud_blob.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_common.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_block_blob.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(operation_context.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_blob_container.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_storage_account.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_blob_client.cpp.o)
...
"_llvm_gcda_start_file", referenced from:
___llvm_gcov_writeout in libazurestorage.a(cloud_blob.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_common.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_block_blob.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(operation_context.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_blob_container.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_storage_account.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_blob_client.cpp.o)
...
"_llvm_gcda_summary_info", referenced from:
___llvm_gcov_writeout in libazurestorage.a(cloud_blob.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_common.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_block_blob.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(operation_context.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_blob_container.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_storage_account.cpp.o)
___llvm_gcov_writeout in libazurestorage.a(cloud_blob_client.cpp.o)
...
"_llvm_gcov_init", referenced from:
___llvm_gcov_init in libazurestorage.a(cloud_blob.cpp.o)
___llvm_gcov_init in libazurestorage.a(cloud_common.cpp.o)
___llvm_gcov_init in libazurestorage.a(cloud_block_blob.cpp.o)
___llvm_gcov_init in libazurestorage.a(operation_context.cpp.o)
___llvm_gcov_init in libazurestorage.a(cloud_blob_container.cpp.o)
___llvm_gcov_init in libazurestorage.a(cloud_storage_account.cpp.o)
___llvm_gcov_init in libazurestorage.a(cloud_blob_client.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]: *** [BlueCloudClientTests] Error 1
make[1]: *** [CMakeFiles/BlueCloudClientTests.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
you do not have enough symbol libraries for the specified architecture
symbol __llvm***
libraries libazurestorage.a
object cloud_***
when building add the necessary code or remove dependencies for your project links to this code
http://logan.tw/posts/2015/04/28/check-code-coverage-with-clang-and-lcov/
add --coverage
option
Adding coverage flags (e.g. via add_definitions(-fprofile-arcs -ftest-coverage)
and link_libraries(--coverage)
) doesn't help
This issue hasn’t been updated in a year; if it is still an issue, please reopen.
So what's the solution for this
Platform: x64-osx Cmake project using
azure-storage-cpp
:I had to add a few other dependencies for
azure-storage-cpp
, such ascpprestsdk
,libxml2
,iconv
,openssl
, but I'm still getting these unresolved symbols:Perhaps similar to facebook/KVOController#65?