0

I am trying to use cocos2d-x as a game engine, and I have already tried using RubyMotion and MonoTouch to check if it is possible to use cocos2d-x binaries. But both, RubyMotion and MonoTouch, are suffering from the same linker error:

  duplicate symbol _SHA1 in:
    libcocos2dx.a(sha-1.o)
    libcocos2dx.a(sha1_one.o)

I did a research and figured out following: _SHA1 symbols are defined in libcurl.a which packed as precompiled static library inside of cocos2d-x externals. During building cocos2d-x XCode calls libtool to create a universal binary libcocos2dx.a And according to this article libtool itself creates duplicated symbols (in some cases related to category bug). Though author states how he has solved similar problem in his case, I am not sure how to apply his solution to my case (if at all it can be applied).

I am not sure where to go from here, since I hoped to use either Ruby or C# to develop my game. Is it possible to solve this libtool/linker problem and get static library without duplicated symbols?

P.S. Please note that if I use same cocos2d-x binaries as a xcode project inside my XCode project, then everything is good. But I want to code in ruby/c#.

DarkDeny
  • 1,750
  • 2
  • 21
  • 31

1 Answers1

0

As an option you could use project template for MacOS which comes with cocos2d-x samples. We've made several projects (two of them are already at the store) this way.

vitaliy
  • 104
  • 1
  • 6
  • I can't find samples in the github repo. Could you please clarify where I can find them? – DarkDeny Mar 01 '14 at 16:43
  • Now I understand what you advice is =). This is not an option in case if I want to develop a game project using Xamarin, or RubyMotion, because in this case libtool problem arises exactly as I described above. – DarkDeny Mar 20 '14 at 11:37
  • In XCode there some linker flags. In our projects there are several of the, for example: -fobjc-arc -all_load -ObjC. Try to use them all (or not all, now I cannot say which ones are used for cocos2d-x lib) in your XCode project or find something similar in case of using another environment. Hope it will help you. – vitaliy Apr 07 '14 at 14:45