Talk:cpp/language/language linkage


Maybe you should mention the difference between:

extern "C" int x; extern "C" { int x; }

The first one is just a declaration and not a definition. The second one is both definition and declaration. See the standard section 7.5 paragraph 7. 11:08, 3 January 2015 (PST)

Actually 7.5 p7 has already been mentioned, at the bottom. I've added a code snippet to demonstrate the said difference. --D41D8CD98F (talk) 07:56, 7 January 2015 (PST)

It would be an idea to add something to the description which points out that this is the keyword to use for building shared libraries or maybe dynamically loadable libraries, too. "g++ -shared" together with 'extern "C"' work well. IMHO better than something like "g++ -rdynamic -fPIC -g -ggdb" and C++-Linkage.

I saw that on and hope whoever had that solution found 'extern "C"' and "g++ -shared". -- 12:54, 15 February 2018 (PST)