2
我在靜態庫中定義了一個std :: map,像這樣警告:std :: binary_function <int,int,bool> :: binary_function()在靜態庫中具有不同的可見性(默認)「* .a」
//////////////////////////////////////
#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是引用第二個塊代碼的目標文件嗎? – onof 2010-07-07 10:59:08