Search code examples
firefox-addonfirefox-addon-sdkxpcom

Compilation of firefox extension with xulrunner-sdk-36.0 C++


I have a FF toolbar working in all previous versions. My toolbar partially written in C++. I've tried to build the C++ part with a new xulrunner-sdk-36.0 I've receive such link errors:

1>xpcomglue_s.lib(nsISupportsImpl.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1600' in Encryption.obj
1>xpcomglue_s.lib(nsStringAPI.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1600' in Encryption.obj
1>xpcomglue_s.lib(nsComponentManagerUtils.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1600' in Encryption.obj
1>xpcomglue_s.lib(nsCOMPtr.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1600' in Encryption.obj
1>xpcomglue_s.lib(nsCRTGlue.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1600' in Encryption.obj
1>xpcomglue_s.lib(nsTArray.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1600' in Encryption.obj

From my first research I've understood that the problem in incompatibility of VS versions. I have tried to recompile VS2010 and VS2012 with same errors.

Somebody know how to solve this?


Solution

  • _MSC_VER 1800 is Visual Studio 2013 and 1600 is Visual Studio 2010. Both compilers are not compatible to each other in C++ mode, so you'll need to recompile either your project or the SDK so that compilers match.

    1800 says to me that the xulrunner SDK was build using VS2013, which is confirmed by the docs, while your project still uses VS2010. (I guess when you tried VS2012, it complained about 1700 not 1600?)

    So you either need to compile your project in VS2013, using the v120 Platform Toolset (See Project Properties/General), or compile a xulrunner SDK yourself using VS2010.

    Starting with Gecko 37, you'll probably need to use VS2013 anyway:

    Please note that as of Firefox 37, earlier versions of Visual Studio will not work. We've started using features of C++11 that are not supported in Visual Studio 2012 and earlier.