Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
build compile err using nsCOMPtr.h and nsIJSRuntimeService.h
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
karthikeyan natarajan  
View profile  
 More options Sep 30 2011, 12:00 am
Newsgroups: mozilla.dev.tech.xpcom
From: karthikeyan natarajan <karthikeya...@gmail.com>
Date: Thu, 29 Sep 2011 21:00:14 -0700 (PDT)
Local: Fri, Sep 30 2011 12:00 am
Subject: build compile err using nsCOMPtr.h and nsIJSRuntimeService.h
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »