error: template with C linkage

If you are facing this error then in some place in our code you have an ‘extern “C” {‘ including a C++ header, like in this example:

#include "someheader"

Then in your someheader.h you have:

extern "C" {
void function(void)

But it doesn’t have the final ‘}’ closing the ‘extern “C” {‘ block.


One thought on “error: template with C linkage

  1. Hi Greg,

    Thank you!

    I created a small python script to search inside the libxx/algorithm.ii :

    f = open("libxx/algorithm.ii", "r")
    searchlines = f.readlines()
    for i, line in enumerate(searchlines):
        if "extern \"C\"" in line: 
            print line
            for l in searchlines[i:i+100]:
                if "\n}" in l:
                    print l
                if "include" in l:
                    print l

    I also helped to see there the issue happens 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s