Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/144.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 警告:std::二进制函数<;int,int,bool>;::二进制函数()在静态库“*”中具有不同的可见性(默认)。a「;_C++_Xcode_Map_Struct_Visibility - Fatal编程技术网

C++ 警告:std::二进制函数<;int,int,bool>;::二进制函数()在静态库“*”中具有不同的可见性(默认)。a「;

C++ 警告:std::二进制函数<;int,int,bool>;::二进制函数()在静态库“*”中具有不同的可见性(默认)。a「;,c++,xcode,map,struct,visibility,C++,Xcode,Map,Struct,Visibility,我在静态库中定义了一个std::map ////////////////////////////////////// #import <map> class CCImage; class ImageArray{ std::map<int,CCImage*> mapCCImages; private: int imagesLength; public: ImageArray(); ~ImageArray(); int getImageLen(); bool 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();
};
/////////////////////////////////////////
//////////////////////////////////////
#进口
类CCImage;
类ImageArray{
std::地图映射图像;
私人:
int图像长度;
公众:
ImageArray();
~ImageArray();
int getImageLen();
bool addCCImage(int键,CCImage*纹理,bool replace=true);
CCImage*getCCImage(int键);
bool deleteCImage(int键);
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;
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
#包括
使用名称空间std;
结构UseGoodStruct{
短古迪德;
字节方向;
};
typedef-map-GOODSMAP;
然后当我定义另一个变量时
GOODSMAP m_thirdLayer;
xcode警告我如下:

#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;
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
ld:warning:std::binary_function::binary_function()在/Users/Vincent/Library/Application Support/QQ/FileRecv/test/libMotion Debug.a(ImageArray.o)和(hidden)中具有不同的可见性(默认)在/Users/Vincent/Library/Application Support/FileRecv/test/build/test.build/Debug iphonesimulator/test.build/Objects normal/i386/GeneralDataManage.o中
ld:warning:std::less::less()在/Users/Vincent/Library/Application Support/FileRecv/test/libMotion Debug.a(ImageArray.o)和/Users/Vincent/Library/Application Support/FileRecv/test/build/test.build/Debug iphonesimulator/test.build/Objects normal/i386/GeneralDataManage.o中具有不同的可见性(默认)
ld:warning:std::less::operator()(int const&,int const&)const在/Users/Vincent/Library/Application Support/FileRecv/test/libMotion Debug.a(ImageArray.o)和(hidden)中具有不同的可见性(默认)在/Users/Vincent/Library/Application Support/FileRecv/test/build/test.build/Debug iphonesimulator/test.build/Objects normal/i386/GeneralDataManage.o中

我怎样才能解决这个问题?谢谢。

尝试在第一个标题中包括,而不是导入。

尝试在第一个标题中包括,而不是导入。

是否为GeneralDataManage.o引用第二个块代码的对象文件?是否为GeneralDataManage.o引用第二个块代码的对象文件?