Mailing List Archive

error: template with C linkage
Hi,
for some of my (older) local ebuild I get the error
template with C linkage

What is the reason for this message?
How can I change "C linkage" to "C++ linkage"

Many thanks for a hint,
Helmut
Re: error: template with C linkage [ In reply to ]
On 2023-01-07 18:20, Helmut Jarausch wrote:
> Hi,
> for some of my (older) local ebuild I get the error
> template with C linkage
>
> What is the reason for this message?
> How can I change "C linkage" to "C++ linkage"

Your C++ code opens an 'extern "C" { ..' block (maybe via included header)
but apparently does not close it correctly. Defining a C++ template in a
C-linkage scope makes no sense, hence the complaint.
To fix you need to find the 'extern "C"' section and make sure it is closed.

cheers
Holger