I am trying to build a java program which makes use of xpcom's
JSRuntime service to execute js files using jni.
I am using eclipse cdt with mingw on win xp.
I have made the preprocessor changes XPCOM_GLUE,MOZILLA_STRICT_API,
also added includes of xulrunner, bin & lib of xulrunner to library
paths.
I was able to build a simple cpp program which starts(NS_InitXPCOM2)
and stops(NS_ShutdownXPCOM) xpcom and sucessfully invoke it from java
program.
Next I made changes to retrieve a nsIServiceManager and then get a
nsIJSRuntimeService from it.
nsCOMPtr<nsIServiceManager> servMan;
NS_InitXPCOM2(getter_AddRefs(servMan),nsnull, nsnull);
nsCOMPtr<nsIJSRuntimeService> jsRuntime;
servMan-
>GetService(nsIJSRuntimeService,NS_GET_IID(nsIJSRuntimeService),getter_AddR efs(jsRuntime));
I started getting the following compilation errors:
C:\xulrunner-5.0.en-US.win32.sdk\xulrunner-sdk\include/nsCOMPtr.h:
886:7: error: an explicit specialization must be preceded by 'template
<>'
C:\xulrunner-5.0.en-US.win32.sdk\xulrunner-sdk\include/nsCOMPtr.h:
1388:7: error: an explicit specialization must be preceded by
'template <>'
C:\xulrunner-5.0.en-US.win32.sdk\xulrunner-sdk\include/
nsIJSRuntimeService.h:33:25: error: 'JSRuntime' has not been declared
C:\xulrunner-5.0.en-US.win32.sdk\xulrunner-sdk\include/
nsIJSRuntimeService.h:43:40: error: 'JSGCCallback' has not been
declared
C:\xulrunner-5.0.en-US.win32.sdk\xulrunner-sdk\include/
nsIJSRuntimeService.h:46:42: error: 'JSGCCallback' has not been
declared
following is the command:
g++ -DXPCOM_GLUE -DMOZILLA_STRICT_API -IC:\xulrunner-5.0.en-
US.win32.sdk\xulrunner-sdk\include -IC:\workspace\xpcom-starter2\src -
IC:\xulrunner-5.0.en-US.win32.sdk\xulrunner-sdk\include\nspr -IC:
\Program Files\Java\jdk1.6.0_04\include -IC:\Program Files\Java
\jdk1.6.0_04\include\win32 -O0 -fsyntax-only -Wall -c -fmessage-
length=0 -osrc\XPCOMStarter.o ..\src\XPCOMStarter.cpp
any ideas on how to fix this?
thanks