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

  • Home
  • SEARCH
  • 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 1010277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:03:28+00:00 2026-05-16T09:03:28+00:00

[SOLVED] I copy the chipmunk folder structure from cocos2d+chipmunk template and build OK. Classes/Chipmunk/include/src

  • 0

[SOLVED]

I copy the chipmunk folder structure from cocos2d+chipmunk template and build OK.

  • Classes/Chipmunk/include/src for ‘src’ folder
  • Classes/Chipmunk/chipmunk for ‘include’ folder

Thanks to Beta for trying to help.

:::::

I download chipmunk 5.3.1 and try with a simple example but I receive this compiled errors:

Undefined symbols:
  "_cpSpaceStep", referenced from:
      -[ChipmunkTestViewController delta:] in ChipmunkTestViewController.o
  "_cpBodyNew", referenced from:
      -[ChipmunkTestViewController configurarChipmunk] in ChipmunkTestViewController.o
  "_cpSpaceAddShape", referenced from:
      -[ChipmunkTestViewController configurarChipmunk] in ChipmunkTestViewController.o
  "_cpSpaceAddBody", referenced from:
      -[ChipmunkTestViewController configurarChipmunk] in ChipmunkTestViewController.o
  "_cpSpaceHashEach", referenced from:
      -[ChipmunkTestViewController delta:] in ChipmunkTestViewController.o
  "_cpInitChipmunk", referenced from:
      -[ChipmunkTestViewController configurarChipmunk] in ChipmunkTestViewController.o
  "_cpCircleShapeNew", referenced from:
      -[ChipmunkTestViewController configurarChipmunk] in ChipmunkTestViewController.o
  "_cpSpaceNew", referenced from:
      -[ChipmunkTestViewController configurarChipmunk] in ChipmunkTestViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

I’m not sure about adding Chipmunk libraries correctly, what sources from chipmunk .tgz I have to include?

Here’s the code:

ChipmunkTestViewController.h

#import <UIKit/UIKit.h>
#import "chipmunk.h"


@interface ChipmunkTestViewController : UIViewController {
    UIImageView *barra;
    UIImageView *esfera;

    cpSpace *space;
}

- (void) configurarChipmunk;
- (void) delta:(NSTimer *)timer;
void updateShape(void *ptr, void *unused);

@end

ChipmunkTestViewController.m

#import "ChipmunkTestViewController.h"

@implementation ChipmunkTestViewController


- (void) configurarChipmunk {
    cpInitChipmunk(); // Init Chipmunk engine

    space = cpSpaceNew(); // Create new Space
    space->gravity = cpv(0, -100); // Direcction and magnitude of gravity in Space

    [NSTimer scheduledTimerWithTimeInterval:1.0f/60.0f target:self selector:@selector(delta:) userInfo:nil repeats:YES];    // NSTimer for animations

    // Create esfera Body
    cpBody *esferaBody = cpBodyNew(50.0f, INFINITY); 
    esferaBody->p = cpv(160,250);
    // Create esfera Shape
    cpShape *esferaShape = cpCircleShapeNew(esferaBody, 15.0f, cpvzero);
    esferaShape->e = 0.5f; // Elasticity
    esferaShape->u = 0.8f; // Friction
    esferaShape->data = esfera; // UIImageView association
    esferaShape->collision_type = 1;

    cpSpaceAddBody(space, esferaBody);
    cpSpaceAddShape(space, esferaShape);

}

- (void) delta:(NSTimer *)timer {
    cpSpaceStep(space, 1.0f/60.0f);     // Refresh Space info
    cpSpaceHashEach(space->activeShapes, &updateShape, nil);     // Refresh Shapes info
}

void updateShape(void *ptr, void *unused) {
    cpShape *shape = (cpShape*)ptr;
    if (shape == nil || shape->body == nil || shape->data == nil) {
        NSLog(@"Invalid Shape...");
        return;
    }
    // Refresh Shape position
    if ([(UIView*)shape->data isKindOfClass:[UIView class]]) {
        [(UIView*)shape->data setCenter:CGPointMake(shape->body->p.x, 480 - shape->body->p.y)];
    } else {
        NSLog(@"Shape updated outside updateShape function...");
    }

}

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];

    barra = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"barra.png"]];
    barra.center = CGPointMake(160, 350);
    esfera = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"esfera.png"]];
    esfera.center = CGPointMake(160, 230);

    [self.view addSubview:barra];
    [self.view addSubview:esfera];

    [self.view setBackgroundColor:[UIColor whiteColor]];

    [self configurarChipmunk];
}

...

@end
  • 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-05-16T09:03:29+00:00Added an answer on May 16, 2026 at 9:03 am

    You should use the iphonestatic.command script in the macosx/ directory to build a static library and copy the headers for you like the README says. Then all you have to do is drop that folder into your project.

    If you are just copying the sources into your project you are almost certainly missing several very important optimization flags. Don’t do it!

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

Sidebar

Ask A Question

Stats

  • Questions 489k
  • Answers 489k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You're not calling it from the OpenGL thread. If a… May 16, 2026 at 9:04 am
  • Editorial Team
    Editorial Team added an answer There's lots of ways to do it, here's one SELECT… May 16, 2026 at 9:04 am
  • Editorial Team
    Editorial Team added an answer string[] listOfControls; //initialize as you will ContentPlaceHolder cph = this.Master.FindControl("TopContentPlaceHolder")… May 16, 2026 at 9:04 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Solved Problem: to show external code dependency by submodules: Thanks to VonC ! Current
(Nearly solved, but not quite) (My temporary solution is to use a void method
How can I copy a polygon to a new location. I use e.isPopupTrigger() to
I have: brand new clean copy of Kohana 2.3.4 (tried 2.4 RC1 also), a
I have a problem with using Phantom do delete and copy recursively. I have
I've seen pieces of this problem solved around the net, yet I'm still confused,
NOTICE: THIS IS SOLVED, I WILL PUBLISH THE SOLUTION HERE ASAP. Hey all, Ok...
Although the problem at hand is solved , it has me a little confused
I decided to use log4net as a logger for a new webservice project. Everything
I am having a problem compiling pdcurses 3.4 in my machine. My OS is

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.