Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't use FMDB with Xcode 4 #10

Closed
lucaquerella opened this issue Apr 8, 2011 · 5 comments
Closed

can't use FMDB with Xcode 4 #10

lucaquerella opened this issue Apr 8, 2011 · 5 comments

Comments

@lucaquerella
Copy link

I created a vergine project on Xcode 4, I imported FMDB (like I did with xcode 3 few months ago) just drugging the source folder, then I add libsqlite3.0.dylib on "Build Phases-> Link Binary With Libraries"

I got this error:
"ld: duplicate symbol _main in /Users/luca/Library/Developer/Xcode/DerivedData/prova4-dsulhpfwtyiffieremqmsufplmzn/Build/Intermediates/prova4.build/Debug-iphonesimulator/prova4.build/Objects-normal/i386/fmdb.o and /Users/luca/Library/Developer/Xcode/DerivedData/prova4-dsulhpfwtyiffieremqmsufplmzn/Build/Intermediates/prova4.build/Debug-iphonesimulator/prova4.build/Objects-normal/i386/main.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"

any suggestion? I really cannot find anything useful anywhere I really want to go on this stuff I'm doing
thank you

@davedelong
Copy link
Contributor

You imported more than you were supposed to. You only need to import FMDatabase.(h/m), FMResultSet.(h/m), and FMDatabaseAdditions.(h/m). You included "fmdb.m" as well, which is the example file showing how to use FMDB. As such, when you compiled your project, the linker found two "main()" functions: one in fmdb.m and one in main.m.

duplicate symbol _main in ...fmdb.o and ...main.o

In other words, this is your problem and not FMDB's. :)

@lucaquerella
Copy link
Author

you were completely right!
thank you very much!!

@cameroncooke
Copy link

might be worth removing the example file from the src/ directory as not to confuse new users as it had me stumped too!

@xx314327475
Copy link

agreen with cameroncooke

@TamilRaja
Copy link

i have lot of solution using but not good result same problem repeated ....

1.compile source checking for duplicate files
2.checked to armv7 and armv7s
3.source file
4.searchpath-framework- empty
5.organizer-leftside myproject - delate the derived data
6.include change import in all implement files
7.same name class name
8.build active architecture only change YES
9.Oter linking flags change to -force_load
10.Add to the frame work game git,quartz core,game git,core data

These all are test my app but not clear the error

ld: 7 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What can i do? Please any other solutions help me friends? i am waiting u r answer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants