link-error: different visibilities

When I use llvm-2.5 to compile gnash which is a GNU flash movie player, some
errors appeared as follow:

llvm-ld: error: Cannot link in module
'../libcore/.libs/libgnashcore.a(movie_root.o)': Linking globals named
'_ZNKSt6vectorIN5gnash8geometry7Range2dIfEESaIS3_EE4sizeEv': symbols have
different visibilities!

Because the name is mangled, I can't find the exact position of this
function in the original source code, so I can't give more information about
it.

Any one will help me?

Thanks!

Gauss, 09-02

gauss wrote:

When I use llvm-2.5 to compile gnash which is a GNU flash movie player, some
errors appeared as follow:

llvm-ld: error: Cannot link in module
'../libcore/.libs/libgnashcore.a(movie_root.o)': Linking globals named
'_ZNKSt6vectorIN5gnash8geometry7Range2dIfEESaIS3_EE4sizeEv': symbols have
different visibilities!

Because the name is mangled, I can't find the exact position of this
function in the original source code, so I can't give more information about
it.

You probably have c++filt installed:

$ c++filt _ZNKSt6vectorIN5gnash8geometry7Range2dIfEESaIS3_EE4sizeEv
std::vector<gnash::geometry::Range2d<float>, std::allocator<gnash::geometry::Range2d<float> > >::size() const

Hope that helps!

Nick

Thanks. It helps me a lot. However, you see, it uses c++ template and
'typedef' and so on, so I still can't find the exact position in the source
code.

And why the llvm-ld fail to link those *.o (compiled from llvm-g++) file? Is
there some mistake in the llvm? I am using llvm-2.5 now.

Nick Lewycky wrote:

gauss wrote:

When I use llvm-2.5 to compile gnash which is a GNU flash movie player, some
errors appeared as follow:

llvm-ld: error: Cannot link in module
'../libcore/.libs/libgnashcore.a(movie_root.o)': Linking globals named
'_ZNKSt6vectorIN5gnash8geometry7Range2dIfEESaIS3_EE4sizeEv': symbols have
different visibilities!

Because the name is mangled, I can't find the exact position of this
function in the original source code, so I can't give more information about
it.
  

Use the c++filt program (part of GNU binutils) to demangle the name. The
function in question is
std::vector<gnash::geometry::Range2d<float>,
std::allocator<gnash::geometry::Range2d<float> > >::size() const

Sebastian

Thanks. It helps me a lot. The mangled name is a template method
"Vector<>::size()" inserted by llvm-g++ at compile time.
Why did llvm-ld fail to link those *.o files as long as llvm-g++ compiled
all the *.cpp file correctly? Is there some wrong with LLVM-g++? How to deal
with it?

Any ideas about it?

Thanks!

Gauss, 09-03

Sebastian Redl wrote: