c++ - Build XPCOM Mozilla Sample Component -



c++ - Build XPCOM Mozilla Sample Component -

i'm trying build xpcom component available here: http://mxr.mozilla.org/mozilla-central/source/xpcom/sample/

i tried compile own makefile, component isolated whole mozilla sources.

so here file tree:

frinux@bureau /cygdrive/c/dev/central_sample $ ls -rlah .: total 57k d---------+ 1 frinux none 0 jan 15 21:28 . d---------+ 1 frinux none 0 jan 15 20:34 .. ----------+ 1 frinux none 989 jan 15 21:22 makefile ----------+ 1 frinux none 2.4k jan 15 21:05 nsisample.idl ----------+ 1 frinux none 6.0k jan 15 21:05 nssample.cpp ----------+ 1 frinux none 5.1k jan 15 21:06 nssample.h ----------+ 1 frinux none 2.0k jan 15 21:06 nssample.js ----------+ 1 frinux none 131 jan 15 21:06 nssample.manifest ----------+ 1 frinux none 4.7k jan 15 21:06 nssamplemodule.cpp d---------+ 1 frinux none 0 jan 15 21:28 programme ----------+ 1 frinux none 8.7k jan 15 21:06 xpconnect-sample.html ./program: total 16k d---------+ 1 frinux none 0 jan 15 21:28 . d---------+ 1 frinux none 0 jan 15 21:28 .. ----------+ 1 frinux none 2.7k jan 15 21:07 makefile.in ----------+ 1 frinux none 4.5k jan 15 21:07 nstestsample.cpp

here makefile made :

cxx = c++ cppflags += -fno-rtti \ -fno-exceptions \ -shared # alter point @ gecko sdk directory. gecko_sdk_path = /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1 # gcc define allows not have #include mozilla-config # in every .cpp file. if not using gcc remove line , add together # #include "mozilla-config.h" each of .cpp files. gecko_config_include = -include mozilla-config.h gecko_defines = -dxpcom_glue -dxp_win gecko_includes = -i $(gecko_sdk_path)/include gecko_ldflags = -l $(gecko_sdk_path)/lib -lxpcomglue \ -lnspr4 \ -lplds4 files = nssample.cpp nssamplemodule.cpp target = sample.dll build: $(cxx) -wall -os -o $(target) $(gecko_config_include) $(gecko_defines) $(gecko_includes) $(gecko_ldflags) $(cppflags) $(cxxflags) $(files) chmod +x $(target) strip $(target) clean: rm $(target)

i'm trying build cygwin under windows (with gcc & g++ installed).

when compiling, i'm getting thos errors, , after hours of research, still don't understand them:

$ create c++ -wall -os -o greenfox.dll -include mozilla-config.h -dxpcom_glue -dxp_win -i /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include -l /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/lib -lxpcomglue -lnspr4 -lplds4 -fno-rtti -fno-exceptions -shared nssample.cpp nssamplemodule.cpp in file included nssample.cpp:48: nssample.h:44:23: nsisample.h: no such file or directory in file included nssample.cpp:48: nssample.h:64: error: expected class-name before '{' token nssample.h:76: error: `ns_decl_isupports' not name type in file included /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/nsalgorithm.h:43, /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/nstarray.h:45, /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/nsstringapi.h:56, /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/nsembedstring.h:43, nssample.cpp:51: /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/nschartraits.h:143: error: explicit specialization must preceded 'template <>' /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/nschartraits.h:433: error: explicit specialization must preceded 'template <>' /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/nschartraits.h:727: error: explicit specialization must preceded 'template <>' /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/nschartraits.h:763: error: explicit specialization must preceded 'template <>' /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/nschartraits.h:828: error: explicit specialization must preceded 'template <>' /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/nschartraits.h:840: error: explicit specialization must preceded 'template <>' nssample.cpp:61: error: no `nssampleimpl::~nssampleimpl()' fellow member function declared in class `nssampleimpl' nssample.cpp:81: error: no `nsrefcnt nssampleimpl::addref()' fellow member function declared in class `nssampleimpl' nssample.cpp: in fellow member function `nsrefcnt nssampleimpl::addref()': nssample.cpp:81: error: `mrefcnt' undeclared (first utilize function) nssample.cpp:81: error: (each undeclared identifier reported 1 time each function appears in.) nssample.cpp: @ global scope: nssample.cpp:81: error: no `nsrefcnt nssampleimpl::release()' fellow member function declared in class `nssampleimpl' nssample.cpp: in fellow member function `nsrefcnt nssampleimpl::release()': nssample.cpp:81: error: `mrefcnt' undeclared (first utilize function) nssample.cpp: @ global scope: nssample.cpp:81: error: no `nsresult nssampleimpl::queryinterface(const nsiid&, void**)' fellow member function declared in class `nssampleimpl' nssample.cpp: in fellow member function `nsresult nssampleimpl::queryinterface(const nsiid&, void**)': nssample.cpp:81: error: `::nsisample' has not been declared nssample.cpp:81: error: `comtypeinfo' undeclared (first utilize function) nssample.cpp:81: error: expected primary-expression before "int" nssample.cpp:81: error: expected `)' before "int" nssample.cpp:81: error: expected `)' before ';' token nssample.cpp:81: error: `nsisample' has not been declared nssample.cpp:81: error: expected `>' before '*' token nssample.cpp:81: error: expected `(' before '*' token nssample.cpp:81: error: expected primary-expression before '>' token nssample.cpp:81: error: expected `)' before ';' token nssample.cpp: in function `nsresult nssampleimpl_getinterfaceshelper(pruint32*, nsiid***)': nssample.cpp:81: error: `::nsisample' has not been declared nssample.cpp:81: error: `comtypeinfo' undeclared (first utilize function) nssample.cpp:81: error: expected primary-expression before '*' token nssample.cpp:81: error: expected primary-expression before ')' token nssample.cpp:81: error: expected `;' nssample.cpp: @ global scope: nssample.cpp:89: error: no `nsresult nssampleimpl::getvalue(char**)' fellow member function declared in class `nssampleimpl' nssample.cpp:120: error: no `nsresult nssampleimpl::setvalue(const char*)' fellow member function declared in class `nssampleimpl' nssample.cpp:141: error: no `nsresult nssampleimpl::poke(const char*)' fellow member function declared in class `nssampleimpl' nssample.cpp: in fellow member function `nsresult nssampleimpl::poke(const char*)': nssample.cpp:142: error: `setvalue' undeclared (first utilize function) nssample.cpp: @ global scope: nssample.cpp:153: error: no `nsresult nssampleimpl::writevalue(const char*)' fellow member function declared in class `nssampleimpl' in file included /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/mozilla/module.h:44, /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/mozilla/moduleutils.h:42, nssamplemodule.cpp:39: /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/nscomptr.h:895: error: explicit specialization must preceded 'template <>' /cygdrive/c/dev/greenchallenge/xulrunner-sdk-9.0.1/include/nscomptr.h:1366: error: explicit specialization must preceded 'template <>' in file included nssamplemodule.cpp:42: nssample.h:44:23: nsisample.h: no such file or directory in file included nssamplemodule.cpp:42: nssample.h:64: error: expected class-name before '{' token nssample.h:125: error: iso c++ forbids declaration of `ns_decl_nsisample' no type nssample.h:125: error: expected `;' before "private" makefile:27: recipe target `build' failed make: *** [build] error 1

it if there errors in mozilla code... doing wrong ?

thanks !

the of import error seems one, rest looks follow-up errors:

nssample.h:44:23: nsisample.h: no such file or directory

that file needs created @ build time nsisample.idl using xpidl command line tool:

xpidl -m header nsisample.idl

apparently, in newer xulrunner sdk versions utilize pyxpidl instead:

header.py -o nsisample.h nsisample.idl

c++ compiler-errors mozilla xpcom xpi

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -