Error running Simulator: duplicate symbol for architecture i386

ⅰ亾dé卋堺 提交于 2019-12-13 16:18:44

问题


I added ShareKit framework to try and here is the error running it in Simulator:

duplicate symbol _LFHRReadStreamClientCallBack in 
.../Xcode/DerivedData/....build/Objects-normal/i386/LFHTTPRequest-8C6F35228BA446B9.o 
and 
.../Xcode/DerivedData/....build/Objects-normal/i386/LFHTTPRequest-8ACF920D803FDCA6.o 
for architecture i386

I looked at previous posts Build Error - missing required architecture i386 in file and tried to edit project.pbxproj commenting FRAMEWORK_SEARCH_PATHS lines out as well as looking for .framework files accidently added to my project but with no luck.

What else can I try?


回答1:


You've included LFHTTPRequest in your project twice. It's possible that another library (such as sharekit) included it for you, doublecheck the files sharekit includes and remove one copy of LFHTTPRequest and things should compile.




回答2:


This can also happen if you move coredata-generated classes into a group, like "Models" and then regenerate the NSManagedObjectModel subclasses. The generated files will be placed in the project root and added into the build twice.




回答3:


I got the same error when working with TessBaseAPI. I had two c++ files and both had the following declaration:

namespace tesseract {
    class TessBaseAPI;
};

tesseract::TessBaseAPI *tesseract1;
uint32_t *pixels;

The I read the full error message. I got a line there:

duplicate symbol _tesseract1 in

And later, which files contains the duplicate also included (the file name). So, I changed the instance name as follows:

namespace tesseract {
    class TessBaseAPI;
};

tesseract::TessBaseAPI *tesseractNew;
uint32_t *pixelsNew;

That solved my problem.



来源:https://stackoverflow.com/questions/9692385/error-running-simulator-duplicate-symbol-for-architecture-i386

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!