C++ : Extern C Functions inside a Namespace

前端 未结 1 600
逝去的感伤
逝去的感伤 2021-01-17 09:04

I have to link two libraries, say A and B. Some of the files are common in both libraries. So, I declare functions in library A inside a namespace, say abc. So, in A and B,

1条回答
  •  别那么骄傲
    2021-01-17 09:29

    When you use Extern "C" you are turning off name mangling so you lose the namespace information as C has no such concept. This causes a duplicate definition.

    0 讨论(0)
提交回复
热议问题