Duplicate symbols problem trying to use SoundCloud stuff with iOS & OF ...

Hi there,
I followed the official stuff : https://github.com/soundcloud/CocoaSoundCloudAPI
But I have a fail:
Quote

ld: duplicate symbol _main in …

I found these thread but all fixe.didn’t work:
Indeed, I suspect the “-all_load -ObjC” flags to be involved in that error.
But I didn’t achieve to load lib soundcloud stuff one by one…

I also checked in each subprojects:

  • Skip Install to YES
  • Hidden Symbols stuff too

Anyone ?

do they have a function named “main” somewhere? I usually see this when adding an addon to an existing project and forget to remove any examples included

hello,
yes I got it.
I’ll check this but in that case, this isn’t an addon.

I had success with this-example, using
all git submodules as described here
I mean: success without OF currently.

I’m currently digging this and I’ll post asap because I guess it could be interesting for the others too :slight_smile:

I almost succeeded…
My doc is almost ready.

still some symbols problems, but not the same :slight_smile:

Undefined symbols for architecture i386:
“_OBJC_CLASS_$_SCSoundCloud”, referenced from:
objc-class-ref in TheUIController.o
“_OBJC_CLASS_$_SCShareViewController”, referenced from:
objc-class-ref in TheUIController.o
“_OBJC_CLASS_$_SCLoginViewController”, referenced from:
objc-class-ref in TheUIController.o
“_SCUICanceledErrorCode”, referenced from:
___37-[TheUIController shareToSoundCloud:]_block_invoke_0 in TheUIController.o
___block_global_0 in TheUIController.o
“_SCUIErrorDomain”, referenced from:
___37-[TheUIController shareToSoundCloud:]_block_invoke_0 in TheUIController.o
___block_global_0 in TheUIController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

TheUIController is the view controller from which I’m trying to present the soundcloud stuff…
That i386 architecture message is weird ; I put all sub projects included (I mean the soundcloud stuff) to iOS 5.1
I also put Skip Install to YES …

I’m despaires :-/

I forgot “-all_load” flag

Now, only one problem:

ld: duplicate symbol _FT_Get_Advances in …/…/…/libs/freetype/lib/iphone/freetype.a(ftbase.o) and …/…/…/libs/freetype/lib/iphone/freetype.a(ftadvanc.o) for architecture i386

Of course, I guess with other addon or lib we could have more duplicate symbols…

btw, only one here…
trying to fix it right now :smiley:

ok so I still have errors.
to be sure, I’m describing my process here:

1/ I have my project, clean, nice, working.
I’m going to the project folder.

2/ git submoduling!

git submodule add git://github.com/nxtbgthng/OAuth2Client.git
git submodule add git://github.com/soundcloud/CocoaSoundCloudAPI.git
git submodule add git://github.com/nxtbgthng/JSONKit.git
git submodule add git://github.com/nxtbgthng/OHAttributedLabel.git
git submodule add git://github.com/soundcloud/CocoaSoundCloudUI.git

After this step, I’m drag’n’dropping each *.xcodeproj file over my Xcode project in order to include them as submodules/subprojects.

3/ Header Search Paths
I add …/** to search path

4/ Libraries
I add the following lib in Link Binary with Libraries section of the Build Phases of my Target.

* libSoundCloudAPI.a
* libOAuth2Client.a
* libJSONKit.a
* libOHAttributedLabel.a
* libSoundCloudUI.a
* QuartzCore.framework
* AddressBook.framework
* AddressBookUI.framework
* CoreLocation.framework
* Security.framework
* CoreGraphics.framework
* CoreText.framework

5/ Other Linker Flags
Because -ObjC is already added, and -all_load gives errors, I’m using as adviced:
-Wl,-force_load,<path_to_my_lib>/libSoundCloudAPI.a
as given in http://stackoverflow.com/questions/6461502/xcode-force-load-not-working-for-simulator-build

6/ SoundCloud.bundle
I’m drag’n’dropping this from CocoaSoundCloudUI to my own resources group in Xcode

7/ Then, the implementation
I followed the example of usage here

I have many errors.

Does my process fit with … reality and is it the way you made it working ?

Many thanks, Seth (and the others :slight_smile: )

I just post something which has been (again) put as spam…

ok so I still have errors.

to be sure, I’m describing my process here:

1/ I have my project, clean, nice, working.
I’m going to the project folder.

2/ git submoduling!

git submodule add git://github.com/nxtbgthng/OAuth2Client.git
git submodule add git://github.com/soundcloud/CocoaSoundCloudAPI.git
git submodule add git://github.com/nxtbgthng/JSONKit.git
git submodule add git://github.com/nxtbgthng/OHAttributedLabel.git
git submodule add git://github.com/soundcloud/CocoaSoundCloudUI.git

After this step, I’m drag’n’dropping each *.xcodeproj file over my Xcode project in order to include them as submodules/subprojects.

3/ Header Search Paths
I add …/** to search path

4/ Libraries
I add the following lib in Link Binary with Libraries section of the Build Phases of my Target.

* libSoundCloudAPI.a
* libOAuth2Client.a
* libJSONKit.a
* libOHAttributedLabel.a
* libSoundCloudUI.a
* QuartzCore.framework
* AddressBook.framework
* AddressBookUI.framework
* CoreLocation.framework
* Security.framework
* CoreGraphics.framework
* CoreText.framework

5/ Other Linker Flags
Because -ObjC is already added, and -all_load gives errors, I’m using as adviced:
-Wl,-force_load,<path_to_my_lib>/libSoundCloudAPI.a
as given in http://stackoverflow.com/questions/6461502/xcode-force-load-not-working-for-simulator-build

6/ SoundCloud.bundle
I’m drag’n’dropping this from CocoaSoundCloudUI to my own resources group in Xcode

7/ Then, the implementation
I followed the example of usage here

I have many errors.

Does my process fit with … reality and is it the way you made it working ?

Many thanks, Seth (and the others :slight_smile: