sckor/AnystoneStoreKit

How to compile?

cliffjoyce opened this issue · 1 comments

I've been following these instructions:

http://www.anystonetech.com/blog/2011/07/07/in-app-store-with-aststorekit-tutorial-part-1

The Xcode4 build fails with this red error:

ld: duplicate symbol _main in /Users/myname/Library/Developer/Xcode/DerivedData/SharedBuilds/Intermediates/FruitEater.build/Debug-iphonesimulator/FruitEater.build/Objects-normal/i386/main-75D0DAFD9FD33F3D.o and /Users/myname/Library/Developer/Xcode/DerivedData/SharedBuilds/Intermediates/FruitEater.build/Debug-iphonesimulator/FruitEater.build/Objects-normal/i386/main-9B85B978E6CC0A62.o for architecture i386

Xcode also reports these warnings:

no previous prototype for ‘ILSimSKCurrentStorefront’
no previous prototype for ‘ILSimSKAllTierPricesByStorefront’
no previous prototype for ‘ILSimSKLocaleForCurrentStorefront’
no previous prototype for ‘CreateGradientImage’
no previous prototype for ‘MyCreateBitmapContext’

How shall we proceed?

Thanks in advance, and sorry to be a pest.

OK, I figured it out. Posting here in case it helps someone else.

Have to remove the duplicate main.m file from the project.

The first three "no previous prototype" warnings can be eliminated by declaring the three functions as void, like so:

NSString* ILSimSKCurrentStorefront(void)
NSDictionary* ILSimSKAllTierPricesByStorefront(void)
NSLocale* ILSimSKLocaleForCurrentStorefront(void)

The next two "no previous prototype" warnings can be eliminated by declaring them in the UIImageView+ReflectedImage.h file:

extern CGImageRef CreateGradientImage(int pixelsWide, int pixelsHigh);
extern CGContextRef MyCreateBitmapContext(int pixelsWide, int pixelsHigh);