7

I have an error below:

ld /Volumes/Data/Library/Developer/Xcode/DerivedData/uniText-cgynaitlevdrajfeoaldwldehaft/Build/Products/Debug-iphonesimulator/uniText.app/uniText normal i386
    cd "/Volumes/Data/Documents/XCode Projects/Trans SMS"
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Volumes/Data/Library/Developer/Xcode/DerivedData/uniText-cgynaitlevdrajfeoaldwldehaft/Build/Products/Debug-iphonesimulator -F/Volumes/Data/Library/Developer/Xcode/DerivedData/uniText-cgynaitlevdrajfeoaldwldehaft/Build/Products/Debug-iphonesimulator -filelist /Volumes/Data/Library/Developer/Xcode/DerivedData/uniText-cgynaitlevdrajfeoaldwldehaft/Build/Intermediates/uniText.build/Debug-iphonesimulator/uniText.build/Objects-normal/i386/uniText.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework SystemConfiguration -framework MessageUI -framework AddressBook -framework AddressBookUI -framework CoreTelephony -lsqlite3.0 -framework UIKit -framework Foundation -framework CoreGraphics -o /Volumes/Data/Library/Developer/Xcode/DerivedData/uniText-cgynaitlevdrajfeoaldwldehaft/Build/Products/Debug-iphonesimulator/uniText.app/uniText

ld: duplicate symbol _OBJC_IVAR_$_FMDatabase.databasePath in /Volumes/Data/Library/Developer/Xcode/DerivedData/uniText-cgynaitlevdrajfeoaldwldehaft/Build/Intermediates/uniText.build/Debug-iphonesimulator/uniText.build/Objects-normal/i386/FMDatabase-566DC6D59187887D.o and /Volumes/Data/Library/Developer/Xcode/DerivedData/uniText-cgynaitlevdrajfeoaldwldehaft/Build/Intermediates/uniText.build/Debug-iphonesimulator/uniText.build/Objects-normal/i386/FMDatabase-566DC6D59187887D.o for architecture i386
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

Could someone help me out? It used to work properly before. I have no idea what I have changed in the project sources. But I am sure that I never changed anything in that FMDatabase.h and .m.

NobodyNada
  • 7,529
  • 6
  • 44
  • 51
Joshua Son
  • 1,839
  • 6
  • 31
  • 51

6 Answers6

4

The relevant portion of your error is ld: duplicate symbol _OBJC_IVAR_$_FMDatabase.databasePath. For some reason, the linker (ld) is trying to link FMDatabase twice. Check to see if you have multiple copies of it in your project.

lemnar
  • 4,063
  • 1
  • 32
  • 44
  • I think your answer is very reasonable. But if I check the project, I only have one copy of those .h and .m files. Which are FMDatabase.h and FMDatabase.m. What should I look for again? – Joshua Son Aug 18 '11 at 12:21
  • This helped me resolve issue as well - thanks. Simply had a double reference to one file. – Hanaan Rosenthal Jan 19 '12 at 21:32
  • 1
    what do you mean by double reference?? help!!! how to check whether i have double reference for a file??? – OMGPOP May 11 '12 at 14:02
4

I once got this error when I was initializing values to constants defined in the global scope in my .h file.

Solved the problem, by declaring them in the header, and initializing them in the .m file.

toujamaru
  • 111
  • 1
  • 5
3

This is a quite old post, but maybe it still helps somebody.

Just had the same problem, for me the solution was: I accidently linked an .m file in one of the headers instead of the .h file. Just changed that to properly link the .h file.

dakami
  • 319
  • 2
  • 10
1

Check if you import framework which required.

Yanis
  • 21
  • 2
0

I solve the problem by updating my framework.

Jerome
  • 2,114
  • 24
  • 24
0

I solved by performing a Clean .

Then could Build.

George Filippakos
  • 16,359
  • 15
  • 81
  • 92