Много ошибок Apple Mach-O Linker

Я сделал приложение для iPhone в XCode, которое использует DropBox API. У меня есть 23 ошибки, названные Apple Mach-O Linker Errors. Я связал свой двоичный файл с библиотекой dropbox, а также: SystemConfiguration, QuartzCore, Security, CFNetwork, CoreGraphics, UIKit и Foundation. Я не использую все эти фреймворки, но DropBox сказал мне, что я должен импортировать некоторые из них, а я использую остальные.

Что я должен делать?

Вот одна из ошибок:

Ld /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Products/Debug-iphoneos/SnapDrop.app/SnapDrop normal armv7
cd /Users/Zach/Desktop/SnapDrop
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode5-DP3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode5-DP3.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"/Applications/Xcode5-DP3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode5-DP3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Products/Debug-iphoneos -F/Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Products/Debug-iphoneos -F/Users/Zach/Desktop/SnapDrop -F/Users/Zach/Desktop/SnapDrop/../../Downloads/dropbox-ios-sync-sdk-1-1.1.0 -filelist /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Intermediates/SnapDrop.build/Debug-iphoneos/SnapDrop.build/Objects-normal/armv7/SnapDrop.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -framework Dropbox -framework QuartzCore -framework SystemConfiguration -framework Security -framework CFNetwork -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Intermediates/SnapDrop.build/Debug-iphoneos/SnapDrop.build/Objects-normal/armv7/SnapDrop_dependency_info.dat -o /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Products/Debug-iphoneos/SnapDrop.app/SnapDrop

Undefined symbols for architecture armv7:
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*)", referenced from:
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_url_encode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Dropbox(util.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"operator new(unsigned long)", referenced from:
std::__1::__function::__func<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'(), std::__1::allocator<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'()>, void ()>::__clone() const in Dropbox(env.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::reserve(unsigned long)", referenced from:
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_url_encode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Dropbox(util.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"std::__1::chrono::system_clock::now()", referenced from:
std::__1::cv_status std::__1::condition_variable::wait_for<long long, std::__1::ratio<1ll, 1000ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000ll> > const&) in Dropbox(sync.o)
std::__1::cv_status std::__1::condition_variable::wait_for<long, std::__1::ratio<3600ll, 1ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long, std::__1::ratio<3600ll, 1ll> > const&) in Dropbox(api.o)
"std::__1::chrono::steady_clock::now()", referenced from:
std::__1::cv_status std::__1::condition_variable::wait_for<long long, std::__1::ratio<1ll, 1000ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000ll> > const&) in Dropbox(sync.o)
std::__1::cv_status std::__1::condition_variable::wait_for<long, std::__1::ratio<3600ll, 1ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long, std::__1::ratio<3600ll, 1ll> > const&) in Dropbox(api.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*)", referenced from:
dbx_access_info::is_valid(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) const in Dropbox(sync.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"std::__1::__throw_system_error(int, char const*)", referenced from:
std::__1::unique_lock<std::__1::mutex>::unlock() in Dropbox(transfer.o)
std::__1::unique_lock<std::__1::mutex>::lock() in Dropbox(transfer.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long)", referenced from:
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)", referenced from:
LifecycleManager::shutdown() in Dropbox(init.o)
dbx_env::log_upload_thread() in Dropbox(env.o)
"std::nothrow", referenced from:
_dropbox_env_init in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
HttpRequester::create(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*)) in Dropbox(env.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
ThreadLocal<dbx_error_buf>::get() in Dropbox(util.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
dbx_env::~dbx_env() in Dropbox(init.o)
build_authed_url(dbx_account const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(api.o)
dbx_request_json(dbx_account*, HttpRequester&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, char const*, int, std::initializer_list<int> const&, std::__1::unique_ptr<json_t, json_deleter>&) in Dropbox(api.o)
_dropbox_api_unlink in Dropbox(api.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_upload_log_file(dbx_env const*, HttpRequester&, char const*, long long, long long, char const*, long long) in Dropbox(api.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
...
"std::__1::condition_variable::notify_all()", referenced from:
LifecycleManager::kick_cvars() in Dropbox(init.o)
LifecycleManager::ThreadRegistration::~ThreadRegistration() in Dropbox(transfer.o)
LifecycleManager::ThreadRegistration::ThreadRegistration(LifecycleManager&) in Dropbox(transfer.o)
dbx_env::dump_log_buffer() const in Dropbox(env.o)
dbx_env::log_upload_thread() in Dropbox(env.o)
"std::__1::condition_variable::~condition_variable()", referenced from:
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_destroy in Dropbox(init.o)
dbx_env::~dbx_env() in Dropbox(init.o)
__GLOBAL__I_a in Dropbox(env.o)
"std::__1::mutex::unlock()", referenced from:
_dropbox_set_online in Dropbox(init.o)
_dropbox_lib_setup in Dropbox(init.o)
_dropbox_env_shutdown in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_shutdown in Dropbox(init.o)
void LifecycleManager::all_lock_helper<void, dropbox_set_online::$_0>(vq_node<std::__1::mutex&>*, dropbox_set_online::$_0) in Dropbox(init.o)
LifecycleManager::shutdown() in Dropbox(init.o)
...
"operator new(unsigned long, std::nothrow_t const&)", referenced from:
_dropbox_env_init in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
HttpRequester::create(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*)) in Dropbox(env.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
ThreadLocal<dbx_error_buf>::get() in Dropbox(util.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::push_back(char)", referenced from:
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_url_encode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Dropbox(util.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000000000ll> > >)", referenced from:
std::__1::cv_status std::__1::condition_variable::wait_for<long long, std::__1::ratio<1ll, 1000ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000ll> > const&) in Dropbox(sync.o)
std::__1::cv_status std::__1::condition_variable::wait_for<long, std::__1::ratio<3600ll, 1ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long, std::__1::ratio<3600ll, 1ll> > const&) in Dropbox(api.o)
"std::__1::mutex::~mutex()", referenced from:
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_destroy in Dropbox(init.o)
dbx_env::~dbx_env() in Dropbox(init.o)
__GLOBAL__I_a in Dropbox(init.o)
__GLOBAL__I_a in Dropbox(env.o)
"operator delete(void*)", referenced from:
_dropbox_env_destroy in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_destroy in Dropbox(init.o)
dbx_env::log_upload_thread() in Dropbox(env.o)
std::__1::__function::__func<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'(), std::__1::allocator<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'()>, void ()>::~__func() in Dropbox(env.o)
std::__1::__function::__func<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'(), std::__1::allocator<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'()>, void ()>::destroy_deallocate() in Dropbox(env.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
...
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from:
dbx_env::dbx_env(dbx_http const*, dbx_env_config const*) in Dropbox(init.o)
build_authed_url(dbx_account const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(api.o)
_dropbox_api_unlink in Dropbox(api.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_upload_log_file(dbx_env const*, HttpRequester&, char const*, long long, long long, char const*, long long) in Dropbox(api.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
build_authed_url(dbx_account const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(api.o)
dbx_upload_log_file(dbx_env const*, HttpRequester&, char const*, long long, long long, char const*, long long) in Dropbox(api.o)
"std::__1::mutex::lock()", referenced from:
_dropbox_set_online in Dropbox(init.o)
_dropbox_lib_setup in Dropbox(init.o)
_dropbox_env_shutdown in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_shutdown in Dropbox(init.o)
void LifecycleManager::all_lock_helper<void, dropbox_set_online::$_0>(vq_node<std::__1::mutex&>*, dropbox_set_online::$_0) in Dropbox(init.o)
LifecycleManager::shutdown() in Dropbox(init.o)
...
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

4

Решение

Вы не упомянули о добавлении libc++.dylib, в https://www.dropbox.com/developers/sync/sdks/ios:

Убедитесь, что у вас есть CFNetwork.framework, Security.framework,
SystemConfiguration.framework, QuartzCore.framework и Libc ++. dylib
добавлен в ваш проект. Для этого выберите файл вашего проекта в
Проводник, выберите цель и выберите этапы сборки.
подвкладка. Под Link Binary with Libraries нажмите кнопку +, выберите
CFNetwork.framework и нажмите Добавить. Повторите для Security.framework,
SystemConfiguration.framework, QuartzCore.framework и Libc ++. dylib.

Пожалуйста, дайте мне знать, если есть где-то инструкции по установке, которые не упоминают libc++.dylib,

10

Другие решения

Вы можете попробовать добавить libstdc ++. Dylib.

0

По вопросам рекламы [email protected]