2010-07-07 2 views
2

Je définis une std :: map dans la bibliothèque statique .a comme ceciavertissement: std :: binary_function <int, int, bool> :: binary_function() a une visibilité différente (par défaut) dans la bibliothèque statique "* .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(); 
}; 
///////////////////////////////////////// 

Je le compiler la bibliothèque statique dans mes projets Xcode, donc l'importer au projet comme « * .a » mais quand j'utilise une autre définition comme ci-dessous:

#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 me avertissement comme ci-dessous :

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 

Comment puis-je résoudre ce problème? Merci.

+0

GeneralDataManage.o est-il le fichier objet référençant le second code de bloc? – onof

Répondre

0

Essayez d'inclure, ne pas importer dans le premier en-tête.

Questions connexes