mercoledì 13 ottobre 2010

Compiler Error C2733 - second C linkage of overloaded function 'function' not allowed

If we want to use Microsoft Visual C++ 2010 Express to compile a project that includes old Microsoft Platform SDK headers and libraries from previous Express releases, we have to modify Additional include Directories and Additional library Directories.
Microsoft Visual C++ 2010 updates the old Windows SDK adding a new folder in "C:\Program Files" named Microsoft SDKs. This folder contains new headers and new libs, so if we try to compile an old project with persistent references to the old SDK, Visual C++ 2010 will return a bunch of errors C2733 (in my case "second C linkage of overloaded function '_interlockedbittestandset' not allowed").
As said above, the solution is quite easy: update the paths in Additional include Directories and Additional library Directories. (example, from C:\Program Files\\Microsoft Platform SDK\Include    to C:\Program Files\Microsoft SDKs\Windows\v7.0A\include).

Best regards.