相关疑难解决方法(0)

#import仍会出现"重复符号"错误

当我编译我的iPhone应用程序时,xCode为MyConstants.h中的变量提供了"重复符号"错误

我想如果我用过:

#import "MyConstants.h"
Run Code Online (Sandbox Code Playgroud)

它会避免这种情况吗?

但我仍然有问题.

补充信息:

  • 在"链接"期间发生错误.(我只是使用xCode的"Build and Go"按钮.)

  • 我也尝试了(#import不必要的)#ifndef/def方法.

    也许我应该问这个:

    如果您需要在所有源代码文件的每个部分中访问常量...您将在.h文件中放入什么?您将使用什么来将该常量包含在代码的其他部分中.

    我想(但我猜它不是)它很简单:

  • MyConstants.h> int thisIsGlobal = 123;

    (不管我在哪里在任何代码中的任何地方重新定义thisIsGlobal.)

    然后在我的其他每个源文件的顶部只添加"#import MyConstants.h".

  • c iphone import xcode compiler-errors

    10
    推荐指数
    3
    解决办法
    6393
    查看次数

    ld:架构armv7的871个重复符号,clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

    我在我的iPhone应用程序中使用FastPDFKit来显示PDF.当我在模拟器上运行项目时,它工作正常.但是,当我在iPhone上运行该项目时,它给我以下错误.

    duplicate symbol _value_map in:
        /Users/alkandari/Desktop/iPhone Apps/MyTest002/MyTest002/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit)
    duplicate symbol _writeUnicodeToUTF8Buffer in:
        /Users/alkandari/Desktop/iPhone Apps/MyTest002/MyTest002/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit)
    ld: 871 duplicate symbols for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    ld: 871 duplicate symbols for architecture armv7
    
    
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    Run Code Online (Sandbox Code Playgroud)

    知道为什么会这样吗?


    当我在Debug and Release部分的Configuration中添加FastPDFFramework时出现错误.

    iphone objective-c ios ios6

    3
    推荐指数
    1
    解决办法
    9985
    查看次数

    xcode 5 ld:架构armv7 clang的11个重复符号:错误:链接器命令失败,退出代码为1(使用-v查看调用)

    在尝试构建我的项目时,我不断得到这个错误,说ld: 11 duplicate symbols for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) 我最近尝试将GPUImage实现到我的项目中,这与它有什么关系吗?我也读过类似的问题,但没有人有我的解决方案.

    xcode linker-errors ios

    2
    推荐指数
    1
    解决办法
    3870
    查看次数

    iOS4.1 SDK中单个库中的重复符号

    我正在开发一个iPhone应用程序.我对Xcode不熟悉,所以请耐心等待.我有iOS 4.1 Device SDK.当我在"Active ..."下拉框中选择"Simulator"时,我的应用程序编译没有错误并在iPhone模拟器中运行.

    但是,当我在下拉框中选择"设备"时,我收到有关重复符号的以下链接器错误:

    Ld build/PineCone.build/Debug-iphoneos/PineCone.build/Objects-normal/armv6/PineCone normal armv6
    cd /Users/isaacsutherland/fydp/PineCone/PineCone
    setenv IPHONEOS_DEPLOYMENT_TARGET 4.1
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk -L/Users/isaacsutherland/fydp/PineCone/PineCone/build/Debug-iphoneos -L/Users/isaacsutherland/fydp/PineCone/PineCone/../3rd/libGHUnitIPhone -F/Users/isaacsutherland/fydp/PineCone/PineCone/build/Debug-iphoneos -filelist /Users/isaacsutherland/fydp/PineCone/PineCone/build/PineCone.build/Debug-iphoneos/PineCone.build/Objects-normal/armv6/PineCone.LinkFileList -dead_strip -all_load -ObjC -miphoneos-version-min=4.1 -framework Foundation -framework UIKit -framework CoreGraphics /Users/isaacsutherland/fydp/PineCone/3rd/three20/Build/Products/Debug-iphoneos/libThree20.a /Users/isaacsutherland/fydp/PineCone/3rd/three20/Build/Products/Debug-iphoneos/libThree20Core.a /Users/isaacsutherland/fydp/PineCone/3rd/three20/Build/Products/Debug-iphoneos/libThree20Network.a /Users/isaacsutherland/fydp/PineCone/3rd/three20/Build/Products/Debug-iphoneos/libThree20Style.a /Users/isaacsutherland/fydp/PineCone/3rd/three20/Build/Products/Debug-iphoneos/libThree20UI.a /Users/isaacsutherland/fydp/PineCone/3rd/three20/Build/Products/Debug-iphoneos/libThree20UICommon.a /Users/isaacsutherland/fydp/PineCone/3rd/three20/Build/Products/Debug-iphoneos/libThree20UINavigator.a -framework QuartzCore -framework CFNetwork -framework MobileCoreServices -framework SystemConfiguration -lz.1.2.3 /Users/isaacsutherland/fydp/PineCone/ClientDal/build/Debug-iphoneos/libClientDal.a -lGHUnitIPhone4_0 -o /Users/isaacsutherland/fydp/PineCone/PineCone/build/PineCone.build/Debug-iphoneos/PineCone.build/Objects-normal/armv6/PineCone
    
    ld: duplicate symbol _RedirectionLimit in /Users/isaacsutherland/fydp/PineCone/ClientDal/build/Debug-iphoneos/libClientDal.a(libASIHTTPRequest.a-armv6-master.o) and /Users/isaacsutherland/fydp/PineCone/ClientDal/build/Debug-iphoneos/libClientDal.a(libASIHTTPRequest.a-armv6-master.o)
    collect2: ld returned 1 exit status
    Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
    
    Run Code Online (Sandbox Code Playgroud)

    错误是奇怪的,因为它抱怨_RedirectionLimit被发现两次 …

    xcode xcodebuild ios4 ios

    0
    推荐指数
    1
    解决办法
    4772
    查看次数