swang
swang

Reputation: 5249

Does linker recognise namespace alias?

I'm compiling a program on Windows using vs2008, I get a linker error LNK2019, my object file has a unresolved symbol

func(boost::shared_ptr<Type> x)

The library A I'm linking is supposed to define this symbol, but dumpbin shows the symbol defined is

func(boost_1_53_0::shared_ptr<Type> x)

I think the boost library is using bcp to make boost a alias of boost_1_53_0, but does the linker know about namespace alias?

If not, where does this build go wrong?

Upvotes: 2

Views: 241

Answers (2)

swang
swang

Reputation: 5249

I think the answer is: no, the linker doesn't care about namespace alias, all symbols should be unified, the problem here is library A was not build correctly with boost 1.53.

Upvotes: 1

Aron Wolf
Aron Wolf

Reputation: 58

no, this is not the problem. Could we see your code? probably you need to include the header. It look like forwarding, but shared_ptr is a template class. so forwarding is not a good idea

Upvotes: 0

Related Questions