Compiling Issues - Both static library and adding references to project - YouTube for iPhone

60 views
Skip to first unread message

seejaneworkit

unread,
Aug 23, 2011, 8:30:31 PM8/23/11
to Google Data APIs Objective-C Client Library Discussion
I've been having problems trying to compile the static library or
adding references to my project using the most current Google Code in
SVN. The YouTube example provided also has issues with its references
to the GData project and does not compile despite my efforts to relink
the project prior to compiling and/or allowing it to use the dynamic
references and copy scripts it includes by default.

The static library is preferred but the steps provided in the Wiki to
create it are a bit unclear. If there are better steps or screenshots,
that would be preferred. http://code.google.com/p/gdata-objectivec-client/wiki/BuildingTheLibrary

In trying to add the resources directly to my project I get a
duplicate symbol error for main at compile-time. If I remove the GData
resources, the error disappears ( see below ).

If there is a better example of a functional project with the GData
static library that would be great. Otherwise, if there are steps to
resolve the compile-time errors for the YouTube example within the
GData project, that would also be great. However, that example doesn't
appear to be using the static library.

Any help to get this code to compile would be greatly appreciated.
And, if JSON is anywhere in the foreseeable future, I would love to
know. XML is less than optimal for mobile development.

Thanks in advance!
Jane


Ld "/Users/seejaneworkit/Library/Developer/Xcode/DerivedData/
Drive_Me_Crazy-adfsjujimcorzheiaqddfrkfuodf/Build/Products/Debug-
iphonesimulator/DMC Dev.app/DMC Dev" normal i386
cd /Users/seejaneworkit/Sites/iPhone/DriveMeCrazy/trunk
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/
Users/seejaneworkit/Library/Developer/Xcode/DerivedData/Drive_Me_Crazy-
adfsjujimcorzheiaqddfrkfuodf/Build/Products/Debug-iphonesimulator -L/
Users/seejaneworkit/Sites/iPhone/DriveMeCrazy/trunk/Libraries/Flurry -
L/Users/seejaneworkit/Sites/iPhone/DriveMeCrazy/trunk -F/Users/
seejaneworkit/Library/Developer/Xcode/DerivedData/Drive_Me_Crazy-
adfsjujimcorzheiaqddfrkfuodf/Build/Products/Debug-iphonesimulator -F/
Users/seejaneworkit/Sites/iPhone/DriveMeCrazy/trunk -filelist "/Users/
seejaneworkit/Library/Developer/Xcode/DerivedData/Drive_Me_Crazy-
adfsjujimcorzheiaqddfrkfuodf/Build/Intermediates/Drive Me Crazy.build/
Debug-iphonesimulator/DMCDev.build/Objects-normal/i386/DMC
Dev.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version
-Xlinker 2 -lxml2 -framework MobileCoreServices -lFlurryWithLocation -
framework Foundation -weak_framework UIKit -framework CoreGraphics -
framework MapKit -framework CoreLocation -framework
SystemConfiguration -lz.1.2.3 -framework AVFoundation -framework
CoreAudio -framework CFNetwork -framework Security -framework
AudioToolbox -o "/Users/seejaneworkit/Library/Developer/Xcode/
DerivedData/Drive_Me_Crazy-adfsjujimcorzheiaqddfrkfuodf/Build/Products/
Debug-iphonesimulator/DMC Dev.app/DMC Dev"

ld: duplicate symbol _main in /Users/seejaneworkit/Library/Developer/
Xcode/DerivedData/Drive_Me_Crazy-adfsjujimcorzheiaqddfrkfuodf/Build/
Intermediates/Drive Me Crazy.build/Debug-iphonesimulator/DMCDev.build/
Objects-normal/i386/GenerateTargetNamespaceMacros.o and /Users/
seejaneworkit/Library/Developer/Xcode/DerivedData/Drive_Me_Crazy-
adfsjujimcorzheiaqddfrkfuodf/Build/Intermediates/Drive Me Crazy.build/
Debug-iphonesimulator/DMCDev.build/Objects-normal/i386/main.o for
architecture i386
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/
bin/llvm-gcc-4.2 failed with exit code 1

Jarek Wilkiewicz

unread,
Aug 24, 2011, 1:44:58 PM8/24/11
to gdata-objec...@googlegroups.com
Hi Jane,

I tried building the Examples/YouTubeSample with XCode 4.0.2 and it compiled and ran with no issues.
The steps I followed were:

1. svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only
2. Open "YouTubeSample.xcodeproj"
3. Select "GData.xcodeproj" then Build
4. Select "YouTubeSample" then Build
5. Run YouTubeSample

Also, the GDataStaticTouchLib builds fine in my environment as well (screen shot attached). The steps I followed were:

1. Open Sources/GData.xcodeproj
2. Select "GDataTouchStaticLib" target
3. Build

Finally I created a sample iPhone application (TestGDataLib), and followed the steps from http://code.google.com/p/gdata-objectivec-client/wiki/BuildingTheLibrary#Linking_to_the_iPhone_Static_Library to include the static lib in my project. Attached are the screen shots. The project built and ran fine. The gdata-include-static-lib-in-project.png is probably the tricky part, I tried to indicate what to drag where in the screen shot. gdata-static-linker-settings.png shows where to set the linker settings. 


thanks,
Jarek


On Aug 23, 5:30 pm, seejaneworkit <seejanewor...@gmail.com> wrote:
> I've been having problems trying to compile the static library or
> adding references to my project using the most current Google Code in
> SVN. The YouTube example provided also has issues with its references
> to the GData project and does not compile despite my efforts to relink
> the project prior to compiling and/or allowing it to use the dynamic
> references and copy scripts it includes by default.
> The static library is preferred but the steps provided in the Wiki to
> create it are a bit unclear. If there are better steps or screenshots,

--
You received this message because you are subscribed to the Google Groups "Google Data APIs Objective-C Client Library Discussion" group.
To post to this group, send email to gdata-objec...@googlegroups.com.
To unsubscribe from this group, send email to gdata-objectivec-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gdata-objectivec-client?hl=en.


gdata-build-lib.png
gdata-include-static-lib-in-project.png
gdata-static-linker-settings.png

Thomas Van Lenten

unread,
Aug 24, 2011, 2:37:31 PM8/24/11
to gdata-objec...@googlegroups.com
You are getting two copies of main() because of the one in your app and for some reason you added GenerateTargetNamespaceMacros.m also.  That is the source for a tool used to generate that macro file.  It should not be in your executable.

TVL

seejaneworkit

unread,
Aug 24, 2011, 3:47:24 PM8/24/11
to Google Data APIs Objective-C Client Library Discussion
Thank you for the response. I'll run through building each of the
options again to see what I get for results. The Wiki page is now down
so I cannot run through the steps for creating the static library
which is a bit painful. Not sure if its being updated at the moment??

Jane

On Aug 24, 10:44 am, Jarek Wilkiewicz <jar...@google.com> wrote:
> Hi Jane,
>
> I tried building the Examples/YouTubeSample with XCode 4.0.2 and it compiled
> and ran with no issues.
> The steps I followed were:
>
> 1. svn checkouthttp://gdata-objectivec-client.googlecode.com/svn/trunk/gdata-objecti...
> 2. Open "YouTubeSample.xcodeproj"
> 3. Select "GData.xcodeproj" then Build
> 4. Select "YouTubeSample" then Build
> 5. Run YouTubeSample
>
> Also, the GDataStaticTouchLib builds fine in my environment as well (screen
> shot attached). The steps I followed were:
>
> 1. Open Sources/GData.xcodeproj
> 2. Select "GDataTouchStaticLib" target
> 3. Build
>
> Finally I created a sample iPhone application (TestGDataLib), and followed
> the steps fromhttp://code.google.com/p/gdata-objectivec-client/wiki/BuildingTheLibr...
> include the static lib in my project. Attached are the screen shots.
> The
> project built and ran fine. The gdata-include-static-lib-in-project.png is
> probably the tricky part, I tried to indicate what to drag where in the
> screen shot. gdata-static-linker-settings.png shows where to set the linker
> settings.
>
> thanks,
> Jarek
>
> On Aug 23, 5:30 pm, seejaneworkit <seejanewor...@gmail.com> wrote:> I've been having problems trying to compile the static library or
> > adding references to my project using the most current Google Code in
> > SVN. The YouTube example provided also has issues with its references
> > to the GData project and does not compile despite my efforts to relink
> > the project prior to compiling and/or allowing it to use the dynamic
> > references and copy scripts it includes by default.
>
> > The static library is preferred but the steps provided in the Wiki to
> > create it are a bit unclear. If there are better steps or screenshots,
> On Tue, Aug 23, 2011 at 5:30 PM, seejaneworkit <seejanewor...@gmail.com>wrote:
>
>
>
>
>
>
>
> > I've been having problems trying to compile the static library or
> > adding references to my project using the most current Google Code in
> > SVN. The YouTube example provided also has issues with its references
> > to the GData project and does not compile despite my efforts to relink
> > the project prior to compiling and/or allowing it to use the dynamic
> > references and copy scripts it includes by default.
>
> > The static library is preferred but the steps provided in the Wiki to
> > create it are a bit unclear. If there are better steps or screenshots,
>  gdata-build-lib.png
> 181KViewDownload
>
>  gdata-include-static-lib-in-project.png
> 329KViewDownload
>
>  gdata-static-linker-settings.png
> 290KViewDownload
Reply all
Reply to author
Forward
0 new messages