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"
#include 

Then in your someheader.h you have:

extern "C" {
void function(void)
...

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

Reference: https://www.gidforums.com/t-9853.html

Advertisements

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()
    f.close()
    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
                    break
                if "include" in l:
                    print l
            print
    

    I also helped to see there the issue happens ūüôā

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s