【发布时间】:2010-07-07 07:43:02
【问题描述】:
我在静态库 .a 中定义了一个 std::map 像这样
//////////////////////////////////////
#import <map>
class CCImage;
class ImageArray{
std::map<int,CCImage*> mapCCImages;
private:
int imagesLength;
public:
ImageArray();
~ImageArray();
int getImageLen();
bool addCCImage(int key,CCImage * texture,bool replace = true);
CCImage *getCCImage(int key);
bool deleteCCImage(int key);
void releaseResource();
};
/////////////////////////////////////////
我将它作为静态库编译到我的 xcode 项目中,所以将它作为“* .a”导入到项目中 但是当我使用下面的另一个定义时:
#include <map>
using namespace std;
struct UseGoodStruct{
short GoodID;
Byte GDirection;
};
typedef map<int,UseGoodStruct *> GOODSMAP;
and then when I define another variable
GOODSMAP m_thirdLayer;
xcode 警告我如下:
ld: warning: std::binary_function<int, int, bool>::binary_function()has different visibility (default) in /Users/Vincent/Library/Application Support/QQ/FileRecv/test/libMotion-Debug.a(ImageArray.o) and (hidden) in /Users/Vincent/Library/Application Support/FileRecv/test/build/test.build/Debug-iphonesimulator/test.build/Objects-normal/i386/GeneralDataManage.o
ld: warning: std::less<int>::less()has different visibility (default) in /Users/Vincent/Library/Application Support/FileRecv/test/libMotion-Debug.a(ImageArray.o) and (hidden) in /Users/Vincent/Library/Application Support/FileRecv/test/build/test.build/Debug-iphonesimulator/test.build/Objects-normal/i386/GeneralDataManage.o
ld: warning: std::less<int>::operator()(int const&, int const&) consthas different visibility (default) in /Users/Vincent/Library/Application Support/FileRecv/test/libMotion-Debug.a(ImageArray.o) and (hidden) in /Users/Vincent/Library/Application Support/FileRecv/test/build/test.build/Debug-iphonesimulator/test.build/Objects-normal/i386/GeneralDataManage.o
我该如何解决这个问题?谢谢。
【问题讨论】:
-
GeneralDataManage.o 对象文件是否引用了第二个块代码?
标签: c++ xcode map struct visibility