我的 CFLAGS 有
-I../../usr/local/sys/usr/include
Run Code Online (Sandbox Code Playgroud)
正确加载 zlib.h
LDFLAGS 是
LDFLAGS = -L../../usr/local/sys/usr/lib -lxml2 -lzlib
Run Code Online (Sandbox Code Playgroud)
但是当链接器尝试链接时会发生以下情况
1> + Linking project files...
1> ld: library not found for -lzlib
1> collect2: ld returned 1 exit status
1> make: *** [link] Error 1
Run Code Online (Sandbox Code Playgroud)
可能是什么问题呢?
windows7下环境是iosdevenv(所以目录结构与mac os上不同)
OO设计问题.
我想将单例功能继承到不同的类层次结构中.这意味着他们需要在每个层次结构中拥有自己的单例实例.
这是我想要做的一个简短的例子:
class CharacterBob : public CCSprite, public BatchNodeSingleton {
...
}
class CharacterJim : public CCSprite, public BatchNodeSingleton {
...
}
class BatchNodeSingleton {
public:
BatchNodeSingleton(void);
~BatchNodeSingleton(void);
CCSpriteBatchNode* GetSingletonBatchNode();
static void DestroySingleton();
static void initBatchNodeSingleton(const char* asset);
protected:
static CCSpriteBatchNode* m_singletonBatchNode;
static bool singletonIsInitialized;
static const char* assetName;
};
Run Code Online (Sandbox Code Playgroud)
此代码将导致Jim和Bob共享BatchNodeSingleton的受保护成员.我需要他们各自拥有自己的套装.什么是一个好的解决方案?可以通过assetName作为键查找的指针集合?
真的很感激你的想法.
我收到了一个错误.
其中一个源文件引用:
#include <libxml/parser.h>
Run Code Online (Sandbox Code Playgroud)
我正在使用下面的Makefile,尝试链接:
LDFLAGS =-l../../usr/local/sys/usr/lib/libxml2.dylib
Run Code Online (Sandbox Code Playgroud)
路径似乎是正确的,文件就在那里.
IDE的错误详细信息:http : //clip2net.com/clip/m0/1333837472-clip-29kb.png http://clip2net.com/clip/m0/1333837744-clip-32kb.png
我究竟做错了什么?
#############################################################################
# Makefile for iPhone application (X)
#############################################################################
# Define here the name of your project's main executable, and the name of the
# build directory where the generated binaries and resources will go.
NAME = X
OUTDIR = X.app
# Define here the minimal iOS version's MAJOR number (iOS3, iOS4 or iOS5)
IOSMINVER = 5
# List here your project's resource files. They can be …Run Code Online (Sandbox Code Playgroud)