I am trying to make an iPhone app that uses OpenCV plus another C++ Library. It seems to compile and link fine. It actually works. Is just I want to get rid of this ugly warning:
ld: warning: std::vector<int, std::allocator<int> >::_M_insert_aux(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, int const&)has different visibility (default) in /Users/nacho4d/Documents/Projects/iOS/iAR/opencv_device/lib/libcxcore.a(cxdatastructs.o) and (hidden) in /Users/nacho4d/Documents/Projects/iOS/iAR/build/iAR.build/Debug-iphoneos/iAR.build/Objects-normal/armv6/combination.开发者_JAVA百科o
What does it mean?, How can I solve it?
just in case, this is the header of combination class, from the library I mentioned.
//combination.h
typedef std::vector<int> combi;
typedef std::vector< combi > allcombi;
class Combination
{
public:
void Init(const int n, const int m);
allcombi::iterator begin();
allcombi::iterator end();
allcombi::const_iterator begin() const;
allcombi::const_iterator end() const;
private:
void Nest(int nest, int column, int n1, int n2, int k[], allcombi &result);
private:
allcombi m_data;
};
Thanks in advance
Ignacio
It seems libcxcore.a
and combination.o
are compiled with different symbol visibility options.
Read about symbol visibility there.
So, I guess you just need to compile combination.cpp
with -fvisibility=default
flag. If you use XCode, check "Symbols Hidden by Default" setting in "GCC - Code Generation" section. It should be unchecked for both projects.
精彩评论