架构 x86_64 的错误未定义符号: [英] Error Undefined symbols for architecture x86_64:

查看:43
本文介绍了架构 x86_64 的错误未定义符号:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个带有地图框架的项目中工作,一切都很好,直到我开始推送通知并在我的 AppDelegate.h 中编写 @property bool push;.我的 AppDelegate.m 中有这个

I'm working in a project with a map framework and all it's fine until I starts with the push notifications and write @property bool push; in my the AppDelegate.h. I have this in my AppDelegate.m

(void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken{

NSString *key =[[NSUserDefaults standardUserDefaults] stringForKey:@"token"];

if ( key== nil || [key isEqual:@""])
{
    _push=true;
    NSString* token = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] stringByReplacingOccurrencesOfString: @">" withString: @""] stringByReplacingOccurrencesOfString: @" " withString: @""] ;
    NSLog(@"=== Device token: %@", token);
    NSUserDefaults *userdefault = [NSUserDefaults standardUserDefaults];
    [userdefault setObject:token forKey:@"token"];

    NSString *jsonPostBody = [NSString stringWithFormat:@"{\"token\":"
                              "\"%@\""
                              ",\"type\":"
                              "\"ios\""
                              "}",
                              [token stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

    NSData *postData = [jsonPostBody dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];

    NSURL *url = [NSURL URLWithString:@"http://www.turismolapalmadelcondado.es/es/api/push_notifications"];

    NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:url
                                                           cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
                                                       timeoutInterval:180.0];
    [request setHTTPMethod:@"POST"];
    [request setHTTPBody:postData];
    NSString* postDataLengthString = [[NSString alloc]initWithFormat: @"%d", [postData length]];
    [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
    [request setValue:postDataLengthString forHTTPHeaderField:@"Content-Length"];

    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData *data=[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
    NSHTTPURLResponse *httpResponse = response;
    NSLog(@"response text: %@",[[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding] );
    NSLog(@"response status code: %ld", (long)[httpResponse statusCode]);
}

}

问题是,如果我没有定义 push 我在 AppDelegate.m 中有一个错误,但如果我这样做了,框架中有 93 个有相同的错误.我之前没有遇到任何问题,我几乎尝试了我在这里找到的所有解决方案.

The thing is that if I don't define push I have a error in the AppDelegate.m but If I do it have 93 with the same error in the framework. I didn't have any problem before and I almost tried all the solutions I've found here.

体系结构 x86_64 的未定义符号:"BingMapsLayer::BingMapsLayer(std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&, TimeInterval const&, bool,int、int、float、LayerCondition const*、std::__1::vector >)",引用自:G3MScenarioDEMDemoScene.o 中的 G3MScenarioDEMDemoScene::rawActivate(G3MContext const)G3MVectorialDemoScene::rawActivate(G3MContext const*) 在 G3MVectorialDemoScene.oG3MPointCloudDemoScene::rawActivate(G3MContext const*) 在 G3MPointCloudDemoScene.oG3MAnimatedMarksDemoScene::rawActivate(G3MContext const*) in G3MAnimatedMarksDemoScene.oG3MStereoDemoScene::rawActivate(G3MContext const*) 在 G3MStereoDemoScene.oG3MVectorStreaming2DemoScene::rawActivate(G3MContext const*) in G3MVectorStreaming2DemoScene.oG3MStreamingPointCloud2DemoScene::rawActivate(G3MContext const*) in G3MStreamingPointCloud2DemoScene.o...GEOVectorLayer::GEOVectorLayer(int, int, int, int, float, LayerCondition const*, std::__1::vector >)",引用自:G3MVectorialDemoScene::rawActivate(G3MContext const) 在 G3MVectorialDemoScene.oG3M3DSymbologyDemoScene.o 中的 G3M3DSymbologyDemoScene::rawActivate(G3MContext const*)"Mark::Mark(std::__1::basic_string, std::__1::allocator > const&, URL const&, Geodetic3D const&, AltitudeMode, double, bool, float, Color const*, Color const*, int, MarkUserData*, bool, MarkTouchListener*, bool)",引用自:G3MMarksDemoScene_BufferDownloadListener::onDownload(URL const&, IByteBuffer*, bool) 在 G3MMarksDemoScene.oLayer::setTitle(std::__1::basic_string, std::__1::allocator > const&)",引用自:- [ParkingViewController createLayerSet] in ParkingViewController.oG3MRasterLayersDemoScene::createLayerSet(LayerSet*) 在 G3MRasterLayersDemoScene.ostd::string::erase(__gnu_cxx::__normal_iterator, __gnu_cxx::__normal_iterator)",引用自:StringUtils_iOS::ltrim(std::string const&) const in libG3MiOSSDK.a(StringUtils_iOS.o)StringUtils_iOS::rtrim(std::string const&) const 在 libG3MiOSSDK.a(StringUtils_iOS.o)"std::string::erase(unsigned long, unsigned long)",引用自:StringUtils_iOS::replaceAll(std::string const&, std::string const&, std::string const&) const in libG3MiOSSDK.a(StringUtils_iOS.o)std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)",引用自:StringBuilder_iOS::addBool(bool) in libG3MiOSSDK.a(G3MWidget_iOS.o)libG3MiOSSDK.a(IntBuffer_iOS.o) 中的 IntBuffer_iOS::description() constlibG3MiOSSDK.a(FloatBuffer_iOS.o) 中的 FloatBuffer_iOS::description() constShortBuffer_iOS::description() const in libG3MiOSSDK.a(ShortBuffer_iOS.o)std::basic_ostream >& std::operator<<, std::allocator >(std::basic_ostream >&, std::basic_string, std::allocator > const&)",引用自:StringBuilder_iOS::addString(std::string const&) in libG3MiOSSDK.a(G3MWidget_iOS.o)StringUtils_iOS::parseHexInt(std::string const&) const in libG3MiOSSDK.a(StringUtils_iOS.o)ld:找不到架构 x86_64 的符号clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)仅显示前 200 条通知

Undefined symbols for architecture x86_64: "BingMapsLayer::BingMapsLayer(std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&, TimeInterval const&, bool, int, int, float, LayerCondition const*, std::__1::vector >)", referenced from: G3MScenarioDEMDemoScene::rawActivate(G3MContext const) in G3MScenarioDEMDemoScene.o G3MVectorialDemoScene::rawActivate(G3MContext const*) in G3MVectorialDemoScene.o G3MPointCloudDemoScene::rawActivate(G3MContext const*) in G3MPointCloudDemoScene.o G3MAnimatedMarksDemoScene::rawActivate(G3MContext const*) in G3MAnimatedMarksDemoScene.o G3MStereoDemoScene::rawActivate(G3MContext const*) in G3MStereoDemoScene.o G3MVectorStreaming2DemoScene::rawActivate(G3MContext const*) in G3MVectorStreaming2DemoScene.o G3MStreamingPointCloud2DemoScene::rawActivate(G3MContext const*) in G3MStreamingPointCloud2DemoScene.o ... "GEOVectorLayer::GEOVectorLayer(int, int, int, int, float, LayerCondition const*, std::__1::vector >)", referenced from: G3MVectorialDemoScene::rawActivate(G3MContext const) in G3MVectorialDemoScene.o G3M3DSymbologyDemoScene::rawActivate(G3MContext const*) in G3M3DSymbologyDemoScene.o "Mark::Mark(std::__1::basic_string, std::__1::allocator > const&, URL const&, Geodetic3D const&, AltitudeMode, double, bool, float, Color const*, Color const*, int, MarkUserData*, bool, MarkTouchListener*, bool)", referenced from: G3MMarksDemoScene_BufferDownloadListener::onDownload(URL const&, IByteBuffer*, bool) in G3MMarksDemoScene.o "Layer::setTitle(std::__1::basic_string, std::__1::allocator > const&)", referenced from: -[ParkingViewController createLayerSet] in ParkingViewController.o G3MRasterLayersDemoScene::createLayerSet(LayerSet*) in G3MRasterLayersDemoScene.o "std::string::erase(__gnu_cxx::__normal_iterator, __gnu_cxx::__normal_iterator)", referenced from: StringUtils_iOS::ltrim(std::string const&) const in libG3MiOSSDK.a(StringUtils_iOS.o) StringUtils_iOS::rtrim(std::string const&) const in libG3MiOSSDK.a(StringUtils_iOS.o) "std::string::erase(unsigned long, unsigned long)", referenced from: StringUtils_iOS::replaceAll(std::string const&, std::string const&, std::string const&) const in libG3MiOSSDK.a(StringUtils_iOS.o) "std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)", referenced from: StringBuilder_iOS::addBool(bool) in libG3MiOSSDK.a(G3MWidget_iOS.o) IntBuffer_iOS::description() const in libG3MiOSSDK.a(IntBuffer_iOS.o) FloatBuffer_iOS::description() const in libG3MiOSSDK.a(FloatBuffer_iOS.o) ShortBuffer_iOS::description() const in libG3MiOSSDK.a(ShortBuffer_iOS.o) "std::basic_ostream >& std::operator<<, std::allocator >(std::basic_ostream >&, std::basic_string, std::allocator > const&)", referenced from: StringBuilder_iOS::addString(std::string const&) in libG3MiOSSDK.a(G3MWidget_iOS.o) StringUtils_iOS::parseHexInt(std::string const&) const in libG3MiOSSDK.a(StringUtils_iOS.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Showing first 200 notices only

如果您需要更多信息,请告诉我.

If you need something more information, please tell me.

谢谢.

推荐答案

最后我能够修复错误.我在特定框架中遇到了错误,但也许我可以帮助某人.这确实是一个配置错误项目,如果您像我一样使用开源框架,请仔细阅读文档以满足需求,在我的情况下,我需要做两件事才能使其正常工作,但我找不到,我不知道是谁在看直到我看到一些需要和没有的文件.除此之外,框架的ios版本或诸如启用或不启用Bitcode或arc之类的东西,在我的情况下,我必须在调试中启用Bitcode而不是在发布中.要知道这一点,只需查看框架的设置即可.我希望我的经验可以帮助某人.

Finally I was able to fix the error. I had the error in a specific framework but maybe I can help someone. It really was a configuration error project, if you're using as me an opensource framework read the documentation carefully to requirements, in my case was two things that I need to make it work and I couldn't find, I knew not who waslooking until I saw some files that need and don't have. Apart from this, the version of ios of framework or things like enabling or not Bitcode or arc, in my case I had to enable Bitcode in debug but not in release. To know this just looking at settings of framework an patiente. I hope mi experience can hepl someone.

这篇关于架构 x86_64 的错误未定义符号:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆