xpcom vs2010 compile C++ XPCOM for FF extension error

50 Views Asked by At

I'v used header.py and typelib.py to produce .h and .xpt correctly.

https://github.com/mozilla-services/services-central-legacy/tree/master/xpcom/sample

as a reference to compile in VC2010。

These are the errors below:

:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\nserror.h(119): error C2332: 'enum' : missing tag name
1>d:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\nserror.h(119): error C2236: unexpected 'class' 'nsresult'. Did you forget a ';'?
1>d:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\nserror.h(119): error C3381: 'nsresult' : assembly access specifiers are only available in code compiled with a /clr option
1>d:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\nserror.h(120): error C2516: 'uint32_t' : is not a legal base class
1>          d:\program files\microsoft visual studio 10.0\vc\include\stdint.h(23) : see declaration of 'uint32_t'
1>d:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\errorlist.h(4): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\errorlist.h(4): error C2864: 'nsresult::NS_OK' : only static const integral data members can be initialized within a class
1>d:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\errorlist.h(9): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\errorlist.h(9): error C2864: 'nsresult::NS_ERROR_BASE' : only static const integral data members can be initialized within a class
1>d:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\errorlist.h(11): error C2065: 'NS_ERROR_BASE' : undeclared identifier
1>d:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\errorlist.h(11): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\errorlist.h(11): error C2864: 'nsresult::NS_ERROR_NOT_INITIALIZED' : only static const integral data members can be initialized within a class
1>d:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\errorlist.h(13): error C2065: 'NS_ERROR_BASE' : undeclared identifier
1>d:\xpcom\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\errorlist.h(13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   ...............

project property has been set following the xpcom example instructions.

No idea what happened. Really appreciate it if there is any help.

0

There are 0 best solutions below