(no subject)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

(no subject)

Sharon Tam
Hi All,
 
I have defined a function in my c++ class like:
 
virtual int getValue(double* INOUT, const char* field, unsigned short side);
 
INOUT is supposed to store the output of the function
 
The generated java method is exactly what I expect:
public int getValue(double[] INOUT, String field, int side) {
...
}
However, in the runtime, it would complain that NoSuchMethodException.
 
 
My aim is to convert a double pointer parameter in a c++ function to a java double[]
 
Please help
 


<a href="http://us.rd.yahoo.com/evt=38381/ ylc=X3oDMTEzcGlrdGY5BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDMWF1dG9z/*http://autos.yahoo.com/index.html ">Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.
Reply | Threaded
Open this post in threaded view
|

Re: (no subject)

William S Fulton
Sharon Tam wrote:

> Hi All,
>  
> I have defined a function in my c++ class like:
>  
> virtual int getValue(double* INOUT, const char* field, unsigned short side);
>  
> INOUT is supposed to store the output of the function
>  
> The generated java method is exactly what I expect:
> public int getValue(double[] INOUT, String field, int side) {
> ...
> }
> However, in the runtime, it would complain that NoSuchMethodException.
>  
>  
> My aim is to convert a double pointer parameter in a c++ function to a
> java double[]
>  
> Please help
>  

I suggest you modify one of the examples that ship with SWIG and run
that as it sounds like you have a build/linking path issue, but without
a standalone example it is hard to say.

William


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|

How to have swig to interpret double pointer param to double[] in java

Sharon Tam
Hi William,
Thanks for answering my question.  However, before I added the double* param, the method was working fine, so I don't think it's the building and linking issue.  If I want to translate the double* to a double[] in Java, what would you recommend to do?  currently, I have to use double *INOUT in order for swig to interpret as double[].  This double* is supposed to store the output value of the function.

Thanks again,
Sharon

William S Fulton <[hidden email]> wrote:
Sharon Tam wrote:

> Hi All,
>
> I have defined a function in my c++ class like:
>
> virtual int getValue(double* INOUT, const char* field, unsigned short side);
>
> INOUT is supposed to store the output of the function
>
> The generated java method is exactly what I expect:
> public int getValue(double[] INOUT, String field, int side) {
> ...
> }
> However, in the runtime, it would complain that NoSuchMethodException.
>
>
> My aim is to convert a double pointer parameter in a c++ function to a
> java double[]
>
> Please help
>

I suggest you modify one of the examples that ship with SWIG and run
that as it sounds like you have a build/linking path issue, but without
a standalone example it is hard to say.

William


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user


Yahoo! Photos – Showcase holiday pictures in hardcover
Photo Books. You design it and we’ll bind it!