如何将花栗鼠库包含到iPhone Xcode项目中?
[已解决]如何将花栗鼠库包含到iPhone Xcode项目中?,iphone,xcode,build,chipmunk,Iphone,Xcode,Build,Chipmunk,[已解决] 我从cocos2d+花栗鼠模板复制花栗鼠文件夹结构并构建OK * Classes/Chipmunk/include/src for 'src' folder * Classes/Chipmunk/chipmunk for 'include' folder “src”文件夹的class/Chipmunk/include/src “包含”文件夹的类/花栗鼠/花栗鼠 感谢Beta的帮助 ::: 我下载了chipmunk 5.3.1并尝试使用一个简单的示例,但我收到以下编译错误: Unde
我从cocos2d+花栗鼠模板复制花栗鼠文件夹结构并构建OK
* Classes/Chipmunk/include/src for 'src' folder
* Classes/Chipmunk/chipmunk for 'include' folder
“src”文件夹的class/Chipmunk/include/src
“包含”文件夹的类/花栗鼠/花栗鼠
感谢Beta的帮助
:::
我下载了chipmunk 5.3.1并尝试使用一个简单的示例,但我收到以下编译错误:
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
我不确定是否正确添加了花栗鼠库,我必须包括来自Chipmunk.tgz的哪些源代码
代码如下:
花栗鼠测试视图控制器
#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
您应该使用macosx/目录中的iphonestatic.command脚本构建一个静态库,并按照自述文件所述为您复制标题。然后你所要做的就是把这个文件夹放到你的项目中
如果您只是将源代码复制到您的项目中,那么几乎肯定会丢失几个非常重要的优化标志。别这样 您应该使用macosx/目录中的iphonestatic.command脚本构建一个静态库,并按照自述文件所述为您复制标题。然后你所要做的就是把这个文件夹放到你的项目中
如果您只是将源代码复制到您的项目中,那么几乎肯定会丢失几个非常重要的优化标志。别这样 我从cocos2d+花栗鼠模板复制花栗鼠文件夹结构,然后构建OK
* Classes/Chipmunk/include/src for 'src' folder
* Classes/Chipmunk/chipmunk for 'include' folder
我从cocos2d+花栗鼠模板复制花栗鼠文件夹结构并构建OK
* Classes/Chipmunk/include/src for 'src' folder
* Classes/Chipmunk/chipmunk for 'include' folder
这几天我问了同样的问题,我做了这样的事情: 1.-进入project->add to project并找到cocos2d-iphone-0.99.5文件,然后从该目录中我添加了包含花栗鼠文件的外部目录。如果需要,请确保在“将项目复制到目标组文件夹”旁边的框中打勾,然后单击“添加”按钮 <P>2。我遵循本教程:在页面的中间是所有需要添加花栗鼠的信息。 3.-将include constraints/util.h声明更改为:include util.h
我想已经完成了。这几天我也有同样的问题,我做了如下: 1.-进入project->add to project并找到cocos2d-iphone-0.99.5文件,然后从该目录中我添加了包含花栗鼠文件的外部目录。如果需要,请确保在“将项目复制到目标组文件夹”旁边的框中打勾,然后单击“添加”按钮 <P>2。我遵循本教程:在页面的中间是所有需要添加花栗鼠的信息。 3.-将include constraints/util.h声明更改为:include util.h 我想已经完成了。如果你使用椰子豆: 在xCode中单击您的Pods项目 选择花栗鼠物理目标 在“搜索路径”中将“始终搜索用户路径”设置为“是” 标题中的搜索路径集 ${PODS_ROOT}/Headers/Private/chipmunk physics to Recursive and ${PODS_ROOT}/Headers/Public/chipmunk physics to Recursive 如果你使用椰子荚,希望它能帮助别人: 在xCode中单击您的Pods项目 选择花栗鼠物理目标 在“搜索路径”中将“始终搜索用户路径”设置为“是” 标题中的搜索路径集 ${PODS_ROOT}/Headers/Private/chipmunk physics to Recursive and ${PODS_ROOT}/Headers/Public/chipmunk physics to Recursive
希望它能帮助别人您使用什么命令来编译和链接?命令?我使用CMD+B来构建应用程序,在哪里可以找到xcode编译和链接时执行的确切命令?您应该用您的解决方案来回答。你们也可以,若有人投票,你们可以得到代表:你们用什么命令来编译和链接?命令?我使用CMD+B来构建应用程序,在哪里可以找到xcode编译和链接时执行的确切命令?您应该用您的解决方案来回答。你也可以,如果有人投票,你可以得到代表: