Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7861031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:32:05+00:00 2026-06-02T22:32:05+00:00

I have done the following so far: Created workspace Added my project Added the

  • 0

I have done the following so far:

  1. Created workspace
  2. Added my project
  3. Added the Cocos2d iOS project (by dragging dropping into project navigator). It is a sibling of my project (not child).
  4. In my project, in build phase, linked to libcocos2d.a
  5. In build settings of my project – Set Always search paths to YES
  6. Created source tree variable pointing to folder containing cocos2d iOS xcodeproj file.
  7. In user header paths of my project, added source tree variable from step 6. Set as recursive.
    8.In project navigator, clicked on libcocos2d.a library (it appears red). Set location “Relative to build products” You set this in the right most window in Xcode 4.3.1.
  8. Closed workspace, and opened pbxproj file in TextWrangler. Searched for path containing libcocos2d.a Remove path, so the entry only reads “libcocos2d.a” . This is because after compiling the library is in the same build directory of the app anyway.

Codesense and autocomplete work. But this will not compile. Around 70 linker errors pop up when I try to build, all saying something like:

Undefined symbols for architecture armv7:
“_OBJC_CLASS_$_CCDirector”, referenced from:
objc-class-ref in AppDelegate.o
objc-class-ref in ViewController.o
“_kEAGLColorFormatRGB565”, referenced from:
-[RIAppDelegate applicationDidFinishLaunching:] in AppDelegate.o
“_OBJC_CLASS_$_CCTexture2D”, referenced from:
objc-class-ref in AppDelegate.o
“_OBJC_CLASS_$_EAGLView”, referenced from:
objc-class-ref in AppDelegate.o

If I try to build for the simulator, then instead of armv7, it says the symbols are missing for i386. The cocos2d project by itself compiles & builds fine. It is my project which has the above errors.

The cocos2d library is present in the build directory of my app after I try to build.

EDIT: Forgot to mention. I also edited the scheme for my project to not build in parallel. I also added the cocos2d target, and made it the top of the list (so it should build first).

EDIT: To clarify – after making the changes to the pbxproj file as detailed above, the libcocos2d.a file is no longer red. It looks normal. Also my app is also built, even though there are the link errors and the build fails. (It doesn’t actually build, but the product is not “red”. An app file is created in the same location as where the cocos2d library is produced.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:32:08+00:00Added an answer on June 2, 2026 at 10:32 pm

    I’ve been trying for a while to use Cocos2d as a static library, instead of a template. The reason being that it makes it easier to develop my project in a modular fashion. In addition, it makes it easier to switch between cocos2d versions and so on. After searching the cocos2d-x forums I found this link: http://cfc.kizzx2.com/index.php/cocos2d-x-with-xcode-4-from-scratch-without-template/

    I found out the frameworks that I needed to add, and that solved all linking problems.

    I still haven’t submitted an application to the store, so if someone with more experience could look it over to check if there are any pitfalls / errors it would be great. English is a second language for me, so please don’t mind. This was done using cocos2d1.1beta2 and Xcode 4.3.1

    1. Create an Xcode workspace
    2. Navigate to the folder containing the cocos2d xcodeproj file (iOS / Mac). This is where you unzipped cocos2d after downloading it.
    3. Drag and drop the xcodeproj file into the navigator window of Xcode.(left most window).
    4. Click on the tiny triangle near the cocos2d project file so all its contents disappear.
    5. Add a new project to your workspace by right clicking in the navigator and “New Project”. Make sure that the project is added as a sibling to the cocos2d project, and not as a child. I chose single window application (iOS)
    6. In this new project, go to the build settings, and change “Always Search User Paths” to “Yes”
    7. Add the location of your cocos2d folder to “User Header Search Paths”. If you like you can instead add the cocos2d folder to your list of source trees in Xcode, and instead just fill in the name of the variable here. Eg: ${COCOS2D_SRC} . This is handy if later on you want to change the folder structure of build environment.

    8. Click on the target and select the build phases tab. You want to link the following binaries with your library. Make sure they are there.
      libcocos2d.a
      libz.dylib
      libxml2.dylib
      OpenGLES.framework
      QuartzCore.framework
      UIKit.framework
      Foundation.framework
      CoreGraphics.framework

    If libcocos2d.a is “red”, then don’t worry about it. It still compiles / links properly.

    1. Under build settings, change “Build active architectures only” to YES.

    Otherwise you may get an error ignoring file /Users/Pteriedaktyl/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/libcocos2d.a, file was built for archive which is not the architecture being linked (armv6)

    1. In your info.plist file, make sure to remove the entry inside “required device capabilities” that says armv7. Otherwise, your code will only run on newer devices.

    Now you’re set! You should be able to access the cocos2d api from the sibling project. If you ever want to change your version of cocos2d, you just need to change the cocos2d project that is in the workspace, update the source tree path (if necessary), and link to the new libCocos2d.a

    Testing:
    Just to try it out, I modified the app delegate and view controller code to match the code from one of my old hello world projects.

    Please try this out, and add to the thread if you have any problems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have done the following form <% form_for @anexo, :url => {:action => create},
How can I self-sign an iPhone application using Xcode? I have done the following:
I have done an email approval script following James Ferreira's youtube tutorial here .
I have done simple java app for blackberry, while building am getting following error.
I am using following WordPress plugin to send email. http://coffee2code.com/wp-plugins/configure-smtp/ I have done configuration,
I try to get the following done: A WPF application where i have multiple
I have just started using jQuery and although following code gets the job done,
I have created the following tables in SQLite3 to tag items (after reading this
Have done quite a bit of searching for a guide (of any substance) for
Have done some research and found some stuff that may be helpful. I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.