我在Xcode中制作了一个使用DropBox API的iPhone应用程序。我有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)
答案 0 :(得分:10)
您没有提及添加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
的设置说明,请告诉我。
答案 1 :(得分:0)
您可以尝试添加libstdc ++。dylib。