duplicate symbol linker error due to libWeANDSFLibrary.a(ASIReachability.o)

我与影子孤独终老i 提交于 2019-12-02 06:23:07

问题


I am using ASI (ASIHTTPRequest, ASIDownloadCache, Reachability etc) request. Now in my project, I am using reachability.h and .m file.I have added one third party library and in that library I came to know that they are also using ASI library. But as per my knowledge they are using ASIReachability class instead of Reachability. So I added that .h file as well.

Still I am getting linker error which says :

duplicate symbol _kInternetConnection in:

    /Users/goutham.v/Library/Developer/Xcode/DerivedData/My_TWCable-fyaebjpvvaprmgdgtirhzshodpky/Build/Intermediates/My TWCable.build/Debug-iphonesimulator/My TWCable.build/Objects-normal/i386/Reachability.o
    /Users/goutham.v/Desktop/SVN/TWC_BC/12Mar2014_TWCBC/weandsf/iphonesimulator/libWeANDSFLibrary.a(ASIReachability.o)

duplicate symbol _kLocalWiFiConnection in:

    /Users/goutham.v/Library/Developer/Xcode/DerivedData/My_TWCable-fyaebjpvvaprmgdgtirhzshodpky/Build/Intermediates/My TWCable.build/Debug-iphonesimulator/My TWCable.build/Objects-normal/i386/Reachability.o
    /Users/goutham.v/Desktop/SVN/TWC_BC/12Mar2014_TWCBC/weandsf/iphonesimulator/libWeANDSFLibrary.a(ASIReachability.o)

duplicate symbol _kReachabilityChangedNotification in:

    /Users/goutham.v/Library/Developer/Xcode/DerivedData/My_TWCable-fyaebjpvvaprmgdgtirhzshodpky/Build/Intermediates/My TWCable.build/Debug-iphonesimulator/My TWCable.build/Objects-normal/i386/Reachability.o
    /Users/goutham.v/Desktop/SVN/TWC_BC/12Mar2014_TWCBC/weandsf/iphonesimulator/libWeANDSFLibrary.a(ASIReachability.o)
duplicate symbol _kConnectionDown in:

    /Users/goutham.v/Library/Developer/Xcode/DerivedData/My_TWCable-fyaebjpvvaprmgdgtirhzshodpky/Build/Intermediates/My TWCable.build/Debug-iphonesimulator/My TWCable.build/Objects-normal/i386/Reachability.o
    /Users/goutham.v/Desktop/SVN/TWC_BC/12Mar2014_TWCBC/weandsf/iphonesimulator/libWeANDSFLibrary.a(ASIReachability.o)
ld: 4 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please help me. Thanking you.


回答1:


You've receive duplicate symbol error. So you've to search this string _kConnectionDown, _kReachabilityChangedNotification, _kLocalWiFiConnection, _kInternetConnection, and remove duplication from files. I think, you may import Reachability class twice, one from libWeANDSFLibrary.a and another from ASI. Check this. Hope, help you.




回答2:


You may be included that files twice in your project so you should remove any one from the project its all because both getting compiled . Choose project--> go to Build Phases--> Type filename which showing it as error and check whether ho many files are there with same name and choose then remove any one from the list



来源:https://stackoverflow.com/questions/22451795/duplicate-symbol-linker-error-due-to-libweandsflibrary-aasireachability-o

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