Kevin Smith | 5 Mar 18:37 2015
Picon

SWIG_Python_NewPointerObj(NULL, ...) vs SWIG_Python_NewPointerObj(self, ...)?

I’m trying to implement an extension method on a struct using SWIG, but I run into a problem when I have to
call a Python function from that method.  I have an object that I need to convert to a SWIG type as an argument
to a function.  I’m using the -builtin option which is causing me a problem.  It appears as though I should
be using SWIG_NewPointerObj to get a SWIG object of the proper type, but since I’m using -builtin it
tries to use the ‘self’ variable.  ‘self’ in this case is $self: the struct that gets wrapped by
SWIG.  I really need the SWIG wrapped object as self in order for SWIG_NewPointerObj to work properly.

Another option is to call SWIG_Python_NewPointerObj with a NULL as the first argument, which is what
happens if you don’t use -builtin.  I’m not sure what implications that may introduce though.

Does anyone have any suggestions on how to handle this?

Kevin D Smith
Kevin.Smith <at> octobergray.com



Kevin D Smith
Kevin.Smith <at> sas.com



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Swig-user mailing list
(Continue reading)

sathish marappan | 4 Mar 16:35 2015
Picon

Facing issues while wrap c++ to csharp using SWIG

Hi All,

I'm new to SWIG. I need to access c++ project functions from c# project.When i was in research to achieve this, I came to know about SWIG.

My c++ project have many headers and i have added all in  .i file.

My custom build command is..
"echo Invoking SWIG...
echo on
..\swig\swig.exe -cpperraswarn -c++ -csharp "%(FullPath)"
%40echo off "

When i build my project, I'm  getting "error : Syntax error in input(3)." and the error refers this line in one of my header file.
"afx_msg void OnPaint();"

I'm struggling to find out why this is happening. Any input or solutions will be appreciated.

Thanks in Advance.

Regards,
Sathishmarappan


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
HackFail | 3 Mar 14:27 2015
Picon

problems generating R wrapper swig-3.0.5

I can't seem to get swig to generate an R wrapper for me.

I have the folder unzipped in C:\swigwin-3.0.5\swigwin-3.0.5 and have this
appended to PATH in environment variables.

Running swig -swiglib ..I can see that the swig thinks it's stored in the
correct place.

Running swig -version ..I can see the correct version is available and is
compiled.

Running swig -r cgp.i ..I get unable to find swig.swg and r.swg.

I consulted the documentation and the only box I didn't check is the 'make
sure you have done a make install'. Though as I'm running Windows I didn't
think this particularly relevant (as make install is for Unix platforms
right?).

Can anyone lend a hand on this menial little issue. Cheers

--
View this message in context: http://swig.10945.n7.nabble.com/problems-generating-R-wrapper-swig-3-0-5-tp14223.html
Sent from the swig-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Witold E Wolski | 3 Mar 12:28 2015
Picon

Hot wo wrap A_new(A ** a) and A_delete(A* a)?

I have a C library with quite functions like :

A_new(A** a);
A_delete(A * a);

to create and release some complex structures. What is the best way to
wrap them with Swig to java?

--

-- 
Witold Eryk Wolski

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Paul Holmes | 26 Feb 12:10 2015

Calling JAR from C/C++ Application

I have a legacy library, written in Java, distributed as a JAR.

Until now, we’ve always called it from Java programs.

 

Now, a user wants to use it from a C/C++ application of their own.

I know that SWIG is designed to help calling C from Java, but is it also

designed to work the other way round – calling Java from C?

 

(I know that C-to-Java calls are _possible_ through JNI, I’ve done it for one method, and it worked but it wasn’t fun.

Now I’ve got an API with dozens of methods, and I want to make the job more manageable.

My question is: would SWIG make it easier, or is that not really what it’s for?)

 

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Levente Lepárt | 26 Feb 07:49 2015
Picon

reduce runtime code redundanty in wrappers

Hi All,



I'm quite new to swig, and I'm facing a problem that I cannot seem to figure out by myself.
My problem is that when I wrap a single '.c'-file (so that I can use its functions from python later) it generates a couple thousands of line of code, to wrap all the C types ...etc.

BUT:

when I wrap another '.c' file, that will contain the same "runtime" code as well.
As far as I can see the first ~3000 line of code is about the same for my files (nearly identical with the output of 'swig2.0 -python -external-runtime')

So my question is:
Is there a convenient way to remove runtime code from the wrappers, put them into single '.c' file compile it into an '.so' and than use it instead?

I believe that it would decrease runtime code redundancy AND reduce buildtime.
As far as I know there used to be a switch for this ('-noruntime') but it was removed.
I've tried '-DSWIG_NOINCLUDE', but the wrappers are still full with those 'SWIGRUNTIME'...

I've only found this old topic related to my question:


Am I missing something?

Thanks in advance,
~lev






------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Witold E Wolski | 18 Feb 13:07 2015
Picon

[java] std_vector.i and %typemap(javainterfaces)

I am using std_vector.i to wrap std::vectors to java
but would like to add an Java interface they implement.

What I am doing is:
%include <std_string.i>
%template(ImageFormatsVec) std::vector< ImageFormatPtr >;
%typemap(javaimports) ImageFormatsVec "import
ch.imagic.ims.capture.sdk.DefaultImageFormatVector;"
%typemap(javainterfaces) ImageFormatsVec "DefaultImageFormatVector"

While to %typemap code works for "normal" C++ classes wrapped with
swig the typemap information is ignored for the %template'd class.

Is there a "Hack" to get the typemap working?

best Witold

--

-- 
Witold Eryk Wolski

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
Spandan Sharma | 17 Feb 17:53 2015
Picon

C wrapper for C++

I did search for this and answers mostly seem to be more than 2 and half years old at-least. So is there any support for this now and if yes how to do it.

I need a pure C wrapper for C++/C++11 interfaces that I have.

BR//

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Stefan Radomski | 16 Feb 16:02 2015
Picon

Doxygen to JavaDoc - any news?

Hello there,

I’d like to inquire about the current state of the Doxygen->JavaDoc integration. The original GSoC branch used to be available at [1] but is no more. If I recall correctly, JavaDoc integration was hoped to make it into one of the 3.x minor releases. Does anyone have an update on the current situation? Is the branch at [2] usable - its latest commit is 2 years in the past. And did anyone ever worked on [3] as part of the GSoC in 2013?

I for one would also settle for a smaller, sensible subset of Doxygen if the complete grammar is too complicated / unpractical.

Regards and thank you!
  Stefan

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Yulia Manzyuk | 15 Feb 13:44 2015
Picon

Problems with std/std_set.i std/std_container.i

when i try to do 
swig -c++ -python wali.i  
i get these errors:
/opt/local/share/swig/3.0.5/std/std_set.i:23: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_set.i:81: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_container.i:23: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_container.i:72: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_container.i:114: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_container.i:23: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_container.i:72: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_container.i:138: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_container.i:23: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_container.i:72: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_container.i:138: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_container.i:23: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_container.i:72: Error: Missing identifier for #ifdef.
/opt/local/share/swig/3.0.5/std/std_container.i:138: Error: Missing identifier for #ifdef.

How can I fix it?
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Wellington Cordeiro | 15 Feb 07:34 2015

[SWIG 3.0.5 Python] Python 3 generated library broken but Python 2 isn't

I will preface this email by saying that I am complete newb when it comes to SWIG, prior to this week I hadn't heard of it so bear that in mind. I am willing to read up on documentation but need helping finding where to look.


I'm attempting to modify and convert a library called Quickfix so that it will support Python 3. Currently it lacks this support. But when I build and attempt to run the Python Test Suite I see the following error.

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid

Now here is the quickfix.i file's contents and links to the library as well as my own fork of it (I intend to make a PR once I get Python 3 support running.)

quickfix.i
https://gist.github.com/f30f5c670dd7576425f5

Library link
https://github.com/quickfix/quickfix
My fork
https://github.com/wldcordeiro/quickfix

 - Wellington Cordeiro
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user

Gmane