views:

120

answers:

1

I'm sure this is very easy but I'm trying to get the fmdb sqlite wrapper to work in an iPhone project. I've grabbed the files via SVN, and there are 'h' and 'm' files inside an 'src' folder.

I'd assumed that if I right-click the Classes folder and select Add > Existing Files... that would work.

But when I try to compile I get an error about 'duplicate symbol main'. If I uncheck the 'add to targets' box the error goes away but the class doesn't work until I do an include and an error comes back.

Am I totally importing incorrectly?

(The app will involve searching a table of Japanese with many many rows so I'd prefer to stick to sqlite to do it).

+2  A: 

It sounds like you've included the small test program that is distributed with FMDB. You should be fine if you remove the test program file.

Jasarien
Is that the fbdb.m file?
Gazzer
Yeah, you don't need to include that one. The reason you're seeing the duplicate symbol 'main' is because the fmdb program has it's own main function.
Jasarien
What does 'add to targets' mean?
Gazzer
A target is a collection of code, resources and build settings that can result in a product, such as an App bundle, a static library etc. Adding a file to a target means it'll be included in a part of the tars build phases. Eg, adding a .m file to a target will add it to the "compile sources" phase for that particular target.
Jasarien