views:

54

answers:

1

I define a std::map in static library .a like this

//////////////////////////////////////
#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();
};
/////////////////////////////////////////

I compile it as static library into my xcode projects , so import it to project as "* .a " but when I use another definition like below:

#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 warning me like below:

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

How can I solve this problem ? Thanks.

A: 

Try including , not importing in the first header.

onof