<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:www.nabble.com,2006:forum-3365</id>
	<title>Nabble - SWIG</title>
	<updated>2008-07-18T07:52:37Z</updated>
	<link rel="self" type="application/atom+xml" href="http://www.nabble.com/SWIG-f3365.xml" />
	<link rel="alternate" type="text/html" href="http://www.nabble.com/SWIG-f3365.html" />
	<subtitle type="html">SWIG is compiler that connects C and C++ with a variety of  scripting languages including Perl, Python, Tcl, Guile, and Ruby.   People often use it to create scripting language extensions or to create interpreted environments for existing software. SWIG home is &lt;a href=&quot;http://sourceforge.net/projects/swig/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.</subtitle>
	
<entry>
	<id>tag:www.nabble.com,2006:post-18531043</id>
	<title>Re: Premature GC flag (pgcppname) not working (JAVA)</title>
	<published>2008-07-18T07:52:37Z</published>
	<updated>2008-07-18T07:52:37Z</updated>
	<author>
		<name>GtG-2</name>
	</author>
	<content type="html">&lt;div dir=&quot;ltr&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Jul 14, 2008 at 11:58 PM, William S Fulton &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18531043&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;wsf@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
GtG wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Hi,&lt;br&gt;
&lt;br&gt;
I am using Swig version 1.3.35 to wrap a C++ api. But unfortunately I was unable to activate the pgcppname flag used in javain typemaps as in the following example:&lt;br&gt;
&lt;br&gt;
%typemap (javain,pgcppname=&amp;quot;$javainput&amp;quot;) void * &amp;quot;$imclassname.ObjectPool().getObjectUID($javainput)&amp;quot;&lt;br&gt;
&lt;br&gt;
The flag seems to have no effect to the generated code and no warnings given in the output.&lt;br&gt;
Is there anyone else who has encountered a similar problem or am I doing something wrong?&lt;br&gt;
&lt;br&gt;
&lt;/blockquote&gt;
Not sure just from the small snippet of code you give. Have you tried&lt;br&gt;
taking a working example and modifying that? Take a look at&lt;br&gt;
Examples/test-suite/java_prepost.i or get the Date example in the&lt;br&gt;
documentation working first.&lt;br&gt;&lt;font color=&quot;#888888&quot;&gt;
&lt;br&gt;
William&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;While playing with the example you pointed, I realized that this has
something to do with void pointer. &amp;quot;pgcppname&amp;quot; flag in the example also
not works when type changed to the void pointer or to a type unknown by
SWIG.&lt;br&gt;
&lt;br&gt;My complete typemapping code to repeat the issue (excluded javadirector typemaps to keep it simple):&lt;br&gt;&lt;br&gt;&lt;blockquote style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot; class=&quot;gmail_quote&quot;&gt;

&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;%(jni)&amp;nbsp;&amp;nbsp;&amp;nbsp; void * &amp;quot;jint&amp;quot;&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;%(jtype)&amp;nbsp; void * &amp;quot;int&amp;quot;&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;

&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;%(jstype) void * &amp;quot;Object&amp;quot;&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;%typemap(out) void * {&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;

&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;&amp;nbsp; $result = (long) $1;&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;

&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;%typemap(in) void * {&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;
&amp;nbsp; $result = (void *) $input;&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;
}&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;%typemap(javaout) void * {&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;

&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;
&amp;nbsp; return $imclassname.ObjectPool().get($jnicall);&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;
}&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;%typemap(javain, pgcppname=&amp;quot;$javainput&amp;quot;) void * &amp;quot;$imclassname.ObjecPool().getObjectUID($javainput)&amp;quot;&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;

&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;%inline %{&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;struct Obj{&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;

&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;&amp;nbsp; Obj(void * pt)&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;

&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;br&gt;I really stuck to this issue. So any help is appreciated. &lt;/div&gt;
&lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18531043&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Premature-GC-flag-%28pgcppname%29-not-working-%28JAVA%29-tp18378662p18531043.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18530898</id>
	<title>Unable to find 'std_set.i'</title>
	<published>2008-07-18T07:45:27Z</published>
	<updated>2008-07-18T07:45:27Z</updated>
	<author>
		<name>amit.x.goswami</name>
	</author>
	<content type="html">
&lt;br&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;Hello&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;This question has probably been answered
but I'm unable to access the archives right now. I'm trying to generate
Java using SWIG and for the most part it works very nicely. Until I hit
this problem, I added the %include &amp;quot;std_set.i&amp;quot; directive in my
interface file but I get the message &amp;quot;Unable to find std_set.i&amp;quot;.
I checked the Java include directories and sure enough, std_set.i is not
present. Any ideas how I can resolve this?&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;Thanks&lt;/font&gt;
&lt;br&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;Amit&lt;/font&gt;
&lt;br&gt;
&lt;P&gt;&lt;hr size=1&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;
******************************************************************&lt;br&gt;
This E-mail is confidential. It may also be legally privileged. If&lt;br&gt;
you are not the addressee you may not copy, forward, disclose or&lt;br&gt;
use any part of it. If you have received this message in error,&lt;br&gt;
please delete it and all copies from your system and notify the&lt;br&gt;
sender immediately by return E-mail.&lt;br&gt;
&lt;br&gt;
Internet communications cannot be guaranteed to be timely, secure,&lt;br&gt;
error or virus-free. The sender does not accept liability for any&lt;br&gt;
errors or omissions.&lt;br&gt;
******************************************************************&lt;br&gt;
SAVE PAPER - THINK BEFORE YOU PRINT!
&lt;/STRONG&gt;&lt;/P&gt;&lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18530898&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Unable-to-find-%27std_set.i%27-tp18530898p18530898.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18525135</id>
	<title>JNI interface using a cpp library. ---&gt; PLC handler</title>
	<published>2008-07-18T01:53:19Z</published>
	<updated>2008-07-18T01:53:19Z</updated>
	<author>
		<name>Jürgen Iko</name>
	</author>
	<content type="html">&lt;div dir=&quot;ltr&quot;&gt;&lt;div class=&quot;gmail_quote&quot;&gt;Hello all!&lt;br&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;br&gt;Im developing a JNI interface between a C++ library and a JAVA application. The purpose of this application is to provide a communication with a PLC (automotive control unit) over TCP/IP. The needed functionality is allready implemented in the C++ library which works fine under C++. First i wrote my own JNI interface and discovered some parts which would need a lot of time to implement them by hand (like pointers on a list of structures returned by some methods). So i decided to try SWIG and hope it makes my live easier ;).&lt;br&gt;

&lt;br&gt;First some additional information of the PLCHandler. My ressource isnt just a dll/lib file, i have also the .h and cpp files. Furthermore there are also two different types of implementation available.&lt;br&gt;&lt;br&gt;PLCHandler.h&amp;amp;PLCHandler.cpp&amp;nbsp; - Plc handler methods are implemented in one single class&lt;br&gt;

PLCHandlerItf.h&amp;amp;PLCHandler.cpp - Plc handler methods are implemented separated and got the Handlerclass as a argument&lt;br&gt;&lt;br&gt;Further code is included in .lib files or as .h&amp;amp;.cpp files. See the attachment archive.&lt;br&gt;

&lt;br&gt;-------------------------------------------------------------------------------------------------&lt;br&gt;System and Tools:&amp;nbsp; AMD 64 on Vista 64.&amp;nbsp; MSVisualStudio 6&amp;nbsp;&amp;nbsp; Eclipse 3.3.2&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;First i tried to wrapp the the PLCHandler.h. The compiler complained about a sintax error in the PLCHandler.h which isnt possible since its functionality is highly tested and the code released.&lt;br&gt;

&lt;br&gt;&lt;font size=&quot;2&quot;&gt;1&amp;gt;e:\Work\PLCHandlerJavaProject\TH\swigwin-1.3.36\Examples\java\simple&amp;gt;..\..\..\swig.exe
-c++ -java
e:\Work\PLCHandlerJavaProject\TH\swigwin-1.3.36\Examples\java\simple\example.i&lt;br&gt;&lt;span style=&quot;background-color: rgb(255, 255, 51);&quot;&gt;
1&amp;gt;PLCHandler.h(408): Error: Syntax error in input(3).&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255);&quot;&gt;Next i tried to wrapp the PLCHandlerItf.h version. After some time i was able to wrapp the library using the java SWIG tutorials and MSVS6. &lt;/span&gt;&lt;br&gt;

&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;--------Compiler log:&lt;br&gt;&lt;br&gt;1&amp;gt;------ Neues Erstellen gestartet: Projekt: example, Konfiguration: Release Win32 ------&lt;br&gt;1&amp;gt;Die Zwischen- und Ausgabedateien für das Projekt &amp;quot;example&amp;quot; mit der Konfiguration &amp;quot;Release|Win32&amp;quot; werden gelöscht.&lt;br&gt;

1&amp;gt;Ein benutzerdefinierter Buildschritt wird ausgeführt.&lt;br&gt;1&amp;gt;In order to function correctly, please ensure the following environment variables are correctly set:&lt;br&gt;1&amp;gt;JAVA_INCLUDE: c:\Program Files\Java\jdk1.6.0_06\include; C:\Program Files\Java\jdk1.6.0_06\include\win32&lt;br&gt;

1&amp;gt;JAVA_BIN: c:\Program Files\Java\jdk1.6.0_06\bin&lt;br&gt;1&amp;gt;e:\Work\PLCHandlerJavaProject\TH\PLCHandlerJni_Swig&amp;gt;E:\Work\PLCHandlerJavaProject\TH\swigwin-1.3.36\swig.exe -c++ -java e:\Work\PLCHandlerJavaProject\TH\PLCHandlerJni_Swig\PLCHandlerJniWrapp.i &lt;br&gt;

1&amp;gt;e:\Work\PLCHandlerJavaProject\TH\PLCHandlerJni_Swig&amp;gt;if errorlevel 1 goto VCReportError &lt;br&gt;1&amp;gt;e:\Work\PLCHandlerJavaProject\TH\PLCHandlerJni_Swig&amp;gt;goto VCEnd &lt;br&gt;1&amp;gt;Kompilieren...&lt;br&gt;1&amp;gt;PLCHandlerItf.cpp&lt;br&gt;

1&amp;gt;PLCConfig.cpp&lt;br&gt;1&amp;gt;.\PLCConfig.cpp(22) : warning C4996: &amp;#39;strcpy&amp;#39; wurde als veraltet deklariert&lt;br&gt;1&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\string.h(73): Siehe Deklaration von &amp;#39;strcpy&amp;#39;&lt;br&gt;

1&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Meldung: &amp;quot;This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.&amp;quot;&lt;br&gt;1&amp;gt;Code wird generiert...&lt;br&gt;

1&amp;gt;Verknüpfen...&lt;br&gt;1&amp;gt;Das Manifest wird eingebettet...&lt;br&gt;1&amp;gt;Java compile post-build step&lt;br&gt;1&amp;gt;e:\Work\PLCHandlerJavaProject\TH\PLCHandlerJni_Swig&amp;gt;&amp;quot;c:\Program Files\Java\jdk1.6.0_06\bin\javac&amp;quot; *.java &lt;br&gt;

1&amp;gt;e:\Work\PLCHandlerJavaProject\TH\PLCHandlerJni_Swig&amp;gt;if errorlevel 1 goto VCReportError &lt;br&gt;1&amp;gt;e:\Work\PLCHandlerJavaProject\TH\PLCHandlerJni_Swig&amp;gt;goto VCEnd &lt;br&gt;1&amp;gt;Das Buildprotokoll wurde unter &amp;quot;file://e:\Work\PLCHandlerJavaProject\TH\PLCHandlerJni_Swig\Release\BuildLog.htm&amp;quot; gespeichert.&lt;br&gt;

1&amp;gt;example - 0 Fehler, 1 Warnung(en)&lt;br&gt;========== Alles neu erstellen: 1 erfolgreich, Fehler bei 0, 0 übersprungen ==========&lt;br&gt;&lt;br&gt;------&lt;br&gt;&lt;br&gt;So i got all the Methods, classes and structures as java/class files and the related .dll&amp;nbsp; library.&lt;br&gt;

Now im trying to access the methods in my Java project. Yes i used System.load to load the dll and catched possible exceptions. The problem doesnt seem to be the library loading.&lt;br&gt;&lt;br&gt;&amp;nbsp;It fails with :&lt;br&gt;&lt;br&gt;Exception in thread &amp;quot;main&amp;quot; java.lang.UnsatisfiedLinkError: PLCHandlerJNI.PLCHandlerInitByFilePlcName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)J&lt;br&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; at PLCHandlerJNI.PLCHandlerInitByFilePlcName(Native Method)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at PLCHandler.PLCHandlerInitByFilePlcName(PLCHandler.java:20)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at TestClass.main(TestClass.java:29)&lt;br&gt;&lt;br&gt;------&lt;br&gt;&lt;br&gt;My questions:&lt;br&gt;&lt;br&gt;1) Are there any errors in the build process, which i didnt recognise?&lt;br&gt;

2) Ist it possible that the Unsatis.. error is a result of missing files while the SWIG wrapp and build process?&lt;br&gt;3) I got a lot of SWIGTYPE_p_p... pointers. As far as i understand are these result of missing information of the types. Is it possible to wrap also the structures on which these pointers point and map the data in a related structure instance.&lt;br&gt;
4) Any doubts of the PLCHandlerItf.h or PLCHandler.h implementation?&lt;br&gt;
&lt;br&gt;&lt;br&gt;Thanks in advance for a possible answer.&lt;br&gt;Some material for better understanding is attached.(Source files, build logs, ...) (The .lib files are missing because they are to big for the mailing list)&lt;br&gt;I would highly appreciate any suggestion for the implementation.&lt;br&gt;
&lt;br&gt;&lt;br&gt;bet regards &lt;br&gt;
Jürgen Innerkofler&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;&lt;br&gt;&lt;/div&gt;
&lt;br /&gt; &lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18525135&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://www.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;MailingListInfo.rar&lt;/strong&gt; (19K) &lt;a href=&quot;http://www.nabble.com/attachment/18525135/0/MailingListInfo.rar&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/JNI-interface-using-a-cpp-library.----%3E-PLC-handler-tp18525135p18525135.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18522715</id>
	<title>Wanted: Doxygen commented SWIG interface files</title>
	<published>2008-07-17T22:05:00Z</published>
	<updated>2008-07-17T22:05:00Z</updated>
	<author>
		<name>Cheryl-14</name>
	</author>
	<content type="html">&lt;div dir=&quot;ltr&quot;&gt;Hello!&lt;br&gt;&lt;br&gt;I am currently working with SWIG for the Google Summer of
Code Program. I am coding a means to translate Doxygen comments found
in a SWIG Interface file into the native documentation language that
SWIG is interfacing to. The end functionality will be that, for
example, if you are interfacing to Java, the generated Java proxy file
will contain javaDoc versions of the Doxygen comments found in your
original C/C++ header file. This will allow SWIG users to easily
generate documentation that matches the language being interfaced to.&lt;br&gt;
If you use Doxygen to document your code, I would greatly appreciate if
any of you could send me header files you have used with SWIG. Making
up examples is not nearly as useful as seeing code as it exists in the
wild, after all. I would very much like to ensure that my tool is
usable and as stable as I can make it before it is released! If you could please mail interface files as attachments or provide a link to download them, I would very much appreciate it. :)&lt;br&gt;
&lt;br&gt;Thank you,&lt;br&gt;&lt;br&gt;Cheryl&lt;/div&gt;
&lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18522715&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Wanted%3A-Doxygen-commented-SWIG-interface-files-tp18522715p18522715.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18520988</id>
	<title>Re: How to access C/C++ objects from Python</title>
	<published>2008-07-17T18:18:52Z</published>
	<updated>2008-07-17T18:18:52Z</updated>
	<author>
		<name>Gregory Propf</name>
	</author>
	<content type="html">&lt;table cellspacing='0' cellpadding='0' border='0' background='none' style='font-family:arial;font-size:10pt;color:rgb(51, 51, 51);background-color:transparent;width:100%;'&gt;&lt;tr&gt;&lt;td valign='top' style='font: inherit;'&gt;&lt;div id=&quot;yiv2025772499&quot;&gt;Thanks for the log_py_objects hint Kai, I can't believe I did this but I was forgetting that the type was a pointer to the object, not the object itself.&amp;nbsp; I should have payed more attention to that _p_ nonsense.&amp;nbsp; Once I added the * everything worked with the unmangled names just fine.&amp;nbsp; Thanks for the tips on importing too.&amp;nbsp; I now do all that in C++ setting the appropriate global key for the module ref and then creating the implicit module object in the module's dict.&amp;nbsp; It all makes a lot more sense now and I also got rid of a weird bug where my implicit object came up as having a type that began with whatever module I had loaded last!&amp;nbsp; Strangely, this didn't seem to affect anything and the
 program still worked.&amp;nbsp; Must have something to do with the way I was combining python and C++ import code.&amp;nbsp; Anyway, it all works fine now.&amp;nbsp; Thanks!! - Greg&lt;br&gt;&lt;br&gt;--- On &lt;b&gt;Thu, 7/17/08, Kai Sterker &lt;i&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18520988&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kai.sterker@...&lt;/a&gt;&amp;gt;&lt;/i&gt;&lt;/b&gt; wrote:&lt;br&gt;&lt;blockquote style=&quot;border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;&quot;&gt;From: Kai Sterker &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18520988&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kai.sterker@...&lt;/a&gt;&amp;gt;&lt;br&gt;Subject: Re: [Swig-user] How to access C/C++ objects from Python&lt;br&gt;To: &quot;SWIG Users&quot; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18520988&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;swig-user@...&lt;/a&gt;&amp;gt;&lt;br&gt;Date: Thursday, July 17, 2008, 6:02 AM&lt;br&gt;&lt;br&gt;&lt;pre&gt;On Thu, Jul 17, 2008 at 3:32 AM, Gregory Propf &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18520988&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gregorypropf@...&lt;/a&gt;&amp;gt;&lt;br&gt;wrote:&lt;br&gt;&lt;br&gt;&amp;gt; Thanks,  I looked at the code you linked and the wrapper code.  If you&lt;br&gt;&amp;gt; follow the calls&lt;br&gt; in the code you see that you get to SWIG_TypeQueryModule&lt;br&gt;&amp;gt; and that function first looks for the mangled name and then, failing that&lt;br&gt;&amp;gt; looks for the unmangled one.
  In my case though it doesn't seem to&lt;br&gt;work in&lt;br&gt;&amp;gt; the latter case.  There's some stuff about partial vs. full&lt;br&gt;initializations&lt;br&gt;&amp;gt; and I suspect this is the root cause.&lt;br&gt;&lt;br&gt;There isn't much I can say here, unfortunately. The log_py_objects&lt;br&gt;method in that code will print a list of the unmangled types that are&lt;br&gt;currently known to SWIG. But if what you are looking for is not in&lt;br&gt;there, you are on your own, I fear.&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; I also get the impression that the python interpreter called by&lt;br&gt;&amp;gt; PyRun_SimpleString doesn't see everything you do with calls to the C&lt;br&gt;API&lt;br&gt;&amp;gt; though this doesn't make much sense. For instance just calling&lt;br&gt;&amp;gt; PyImport_ImportModule(&quot;mymod&quot;) and &lt;br&gt;PyImport_AddModule(&quot;mymod&quot;) doesn't seem&lt;br&gt;&amp;gt; to work, you need to&lt;br&gt; say &quot;import mymod&quot; in the python code too.&lt;br&gt;&lt;br&gt;Hm ... in our case, the call to PyImport_ImportModule(&quot;foo&quot;) was&lt;br&gt;necessary to get SWIG properly initialized, so that the
 cxx_to_py&lt;br&gt;method works. But all the classes or functions inside that module are&lt;br&gt;local to that specific module. They are not available anywhere else in&lt;br&gt;the Python interpreter.&lt;br&gt;&lt;br&gt;You might be able to get around this by using PyRun_String instead of&lt;br&gt;PyRun_SimpleString, allowing you to specify your own Globals and&lt;br&gt;Locals dictionaries:&lt;br&gt;&lt;br&gt; PyObject *module = PyImport_ImportModule(&quot;foo&quot;);&lt;br&gt; PyObject *globals = PyModule_GetDict (module);&lt;br&gt; PyRun_String (&quot;...&quot;, Py_file_input, globals, NULL);&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; I'm dynamically linking everything.  Is this some linker phenomenon?&lt;br&gt;&lt;br&gt;Same here and it's not a problem. Actually, it's the preferred way,&lt;br&gt;especially when dealing with multiple&lt;br&gt; modules.&lt;br&gt;&lt;br&gt;Kai&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's&lt;br&gt;challenge&lt;br&gt;Build the coolest Linux based applications with Moblin SDK
 &amp;amp; win great&lt;br&gt;prizes&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world&lt;br&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;amp;url=/&lt;br&gt;_______________________________________________&lt;br&gt;Swig-user mailing list&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18520988&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;&lt;br&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/pre&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;

      &lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18520988&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/How-to-access-C-C%2B%2B-objects-from-Python-tp18459360p18520988.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18520661</id>
	<title>Re: how modular is the support for the various languages?</title>
	<published>2008-07-17T17:36:54Z</published>
	<updated>2008-07-17T17:36:54Z</updated>
	<author>
		<name>Olly Betts</name>
	</author>
	<content type="html">On 2008-07-17, William S Fulton &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18520661&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;wsf@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; David Reiser wrote:
&lt;br&gt;&amp;gt;&amp;gt; I know that swig can be built without any of the supported languages &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; installed. What happens if I install swig without any of the languages &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; present and then install some number of the supported languages?
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; I tried building swig both with and without languages present and then &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; looked at the resulting install, but I couldn't tell for sure that &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; there weren't minor changes to the core files.
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; Whether or not any languages are detected or disabled/enabled during 
&lt;br&gt;&amp;gt; configure time makes no difference to what gets installed. The detection 
&lt;br&gt;&amp;gt; of the languages is entirely for testing.
&lt;/div&gt;&lt;br&gt;While I agree that this ought to be the case, currently the presence or
&lt;br&gt;version of Ocaml can make a difference to what gets installed, and thus
&lt;br&gt;to the wrapper code generated.
&lt;br&gt;&lt;br&gt;Ocaml is probed for OCAMLLOC (either loc or _loc) in configure, and this
&lt;br&gt;value is substituted into Lib/ocaml/swigp4.ml.in which is installed and
&lt;br&gt;gets used in the generated wrappers. &amp;nbsp;If it's not installed, it looks
&lt;br&gt;like &amp;quot;loc&amp;quot; is used.
&lt;br&gt;&lt;br&gt;I pointed out the issue here when this change was committed, but got no
&lt;br&gt;response:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://thread.gmane.org/gmane.comp.programming.swig.devel/16510/focus=16512&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://thread.gmane.org/gmane.comp.programming.swig.devel/16510/focus=16512&lt;/a&gt;&lt;br&gt;&lt;br&gt;I'm afraid I know nothing about the internals of Ocaml, so I don't know
&lt;br&gt;how this could be handled better.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&amp;nbsp; &amp;nbsp; Olly
&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18520661&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/how-modular-is-the-support-for-the-various-languages--tp18511599p18520661.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18518089</id>
	<title>Re: how modular is the support for the various languages?</title>
	<published>2008-07-17T14:17:38Z</published>
	<updated>2008-07-17T14:17:38Z</updated>
	<author>
		<name>wsfulton</name>
	</author>
	<content type="html">David Reiser wrote:
&lt;br&gt;&amp;gt; I know that swig can be built without any of the supported languages &amp;nbsp;
&lt;br&gt;&amp;gt; installed. What happens if I install swig without any of the languages &amp;nbsp;
&lt;br&gt;&amp;gt; present and then install some number of the supported languages?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I tried building swig both with and without languages present and then &amp;nbsp;
&lt;br&gt;&amp;gt; looked at the resulting install, but I couldn't tell for sure that &amp;nbsp;
&lt;br&gt;&amp;gt; there weren't minor changes to the core files.
&lt;br&gt;&amp;gt; 
&lt;br&gt;Whether or not any languages are detected or disabled/enabled during 
&lt;br&gt;configure time makes no difference to what gets installed. The detection 
&lt;br&gt;of the languages is entirely for testing.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; My main interest here is a packaging issue that has arisen in fink for &amp;nbsp;
&lt;br&gt;&amp;gt; OS X. If all the languages that both swig and fink support are enabled &amp;nbsp;
&lt;br&gt;&amp;gt; for swig 1.3.35, then several packages in fink that require swig end &amp;nbsp;
&lt;br&gt;&amp;gt; up dragging in octave (and having to compile gcc43 for octave). It's &amp;nbsp;
&lt;br&gt;&amp;gt; pretty annoying to spend 6 hours compiling a compiler to support a &amp;nbsp;
&lt;br&gt;&amp;gt; language one doesn't use just to get swig support for a language that &amp;nbsp;
&lt;br&gt;&amp;gt; one does use. Granted, this problem is as much fink's policy of &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;quot;everything should build the same for every user&amp;quot; as anything else. &amp;nbsp;
&lt;br&gt;&amp;gt; But it would be nice to know/learn how to overlay languages on a base &amp;nbsp;
&lt;br&gt;&amp;gt; swig install without having to modify the swig install itself.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;
&lt;/div&gt;So to sum up you don't need any languages installed in order to build 
&lt;br&gt;and install swig.
&lt;br&gt;&lt;br&gt;William
&lt;br&gt;&lt;br&gt;BTW, I just fixed your SF bug 2019156 about configure --without-octave 
&lt;br&gt;not working.
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18518089&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/how-modular-is-the-support-for-the-various-languages--tp18511599p18518089.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18511599</id>
	<title>how modular is the support for the various languages?</title>
	<published>2008-07-17T08:45:32Z</published>
	<updated>2008-07-17T08:45:32Z</updated>
	<author>
		<name>David Reiser-2</name>
	</author>
	<content type="html">I know that swig can be built without any of the supported languages &amp;nbsp;
&lt;br&gt;installed. What happens if I install swig without any of the languages &amp;nbsp;
&lt;br&gt;present and then install some number of the supported languages?
&lt;br&gt;&lt;br&gt;I tried building swig both with and without languages present and then &amp;nbsp;
&lt;br&gt;looked at the resulting install, but I couldn't tell for sure that &amp;nbsp;
&lt;br&gt;there weren't minor changes to the core files.
&lt;br&gt;&lt;br&gt;My main interest here is a packaging issue that has arisen in fink for &amp;nbsp;
&lt;br&gt;OS X. If all the languages that both swig and fink support are enabled &amp;nbsp;
&lt;br&gt;for swig 1.3.35, then several packages in fink that require swig end &amp;nbsp;
&lt;br&gt;up dragging in octave (and having to compile gcc43 for octave). It's &amp;nbsp;
&lt;br&gt;pretty annoying to spend 6 hours compiling a compiler to support a &amp;nbsp;
&lt;br&gt;language one doesn't use just to get swig support for a language that &amp;nbsp;
&lt;br&gt;one does use. Granted, this problem is as much fink's policy of &amp;nbsp;
&lt;br&gt;&amp;quot;everything should build the same for every user&amp;quot; as anything else. &amp;nbsp;
&lt;br&gt;But it would be nice to know/learn how to overlay languages on a base &amp;nbsp;
&lt;br&gt;swig install without having to modify the swig install itself.
&lt;br&gt;&lt;br&gt;Dave
&lt;br&gt;--
&lt;br&gt;David Reiser
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18511599&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dbreiser@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18511599&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/how-modular-is-the-support-for-the-various-languages--tp18511599p18511599.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18507989</id>
	<title>Re: How to access C/C++ objects from Python</title>
	<published>2008-07-17T06:02:35Z</published>
	<updated>2008-07-17T06:02:35Z</updated>
	<author>
		<name>Kai Sterker-3</name>
	</author>
	<content type="html">On Thu, Jul 17, 2008 at 3:32 AM, Gregory Propf &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18507989&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gregorypropf@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Thanks, &amp;nbsp;I looked at the code you linked and the wrapper code. &amp;nbsp;If you
&lt;br&gt;&amp;gt; follow the calls in the code you see that you get to SWIG_TypeQueryModule
&lt;br&gt;&amp;gt; and that function first looks for the mangled name and then, failing that
&lt;br&gt;&amp;gt; looks for the unmangled one. &amp;nbsp;In my case though it doesn't seem to work in
&lt;br&gt;&amp;gt; the latter case. &amp;nbsp;There's some stuff about partial vs. full initializations
&lt;br&gt;&amp;gt; and I suspect this is the root cause.
&lt;br&gt;&lt;br&gt;There isn't much I can say here, unfortunately. The log_py_objects
&lt;br&gt;method in that code will print a list of the unmangled types that are
&lt;br&gt;currently known to SWIG. But if what you are looking for is not in
&lt;br&gt;there, you are on your own, I fear.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; I also get the impression that the python interpreter called by
&lt;br&gt;&amp;gt; PyRun_SimpleString doesn't see everything you do with calls to the C API
&lt;br&gt;&amp;gt; though this doesn't make much sense. For instance just calling
&lt;br&gt;&amp;gt; PyImport_ImportModule(&amp;quot;mymod&amp;quot;) and &amp;nbsp;PyImport_AddModule(&amp;quot;mymod&amp;quot;) doesn't seem
&lt;br&gt;&amp;gt; to work, you need to say &amp;quot;import mymod&amp;quot; in the python code too.
&lt;br&gt;&lt;br&gt;Hm ... in our case, the call to PyImport_ImportModule(&amp;quot;foo&amp;quot;) was
&lt;br&gt;necessary to get SWIG properly initialized, so that the cxx_to_py
&lt;br&gt;method works. But all the classes or functions inside that module are
&lt;br&gt;local to that specific module. They are not available anywhere else in
&lt;br&gt;the Python interpreter.
&lt;br&gt;&lt;br&gt;You might be able to get around this by using PyRun_String instead of
&lt;br&gt;PyRun_SimpleString, allowing you to specify your own Globals and
&lt;br&gt;Locals dictionaries:
&lt;br&gt;&lt;br&gt;&amp;nbsp;PyObject *module = PyImport_ImportModule(&amp;quot;foo&amp;quot;);
&lt;br&gt;&amp;nbsp;PyObject *globals = PyModule_GetDict (module);
&lt;br&gt;&amp;nbsp;PyRun_String (&amp;quot;...&amp;quot;, Py_file_input, globals, NULL);
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; I'm dynamically linking everything. &amp;nbsp;Is this some linker phenomenon?
&lt;br&gt;&lt;br&gt;Same here and it's not a problem. Actually, it's the preferred way,
&lt;br&gt;especially when dealing with multiple modules.
&lt;br&gt;&lt;br&gt;Kai
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18507989&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/How-to-access-C-C%2B%2B-objects-from-Python-tp18459360p18507989.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18499918</id>
	<title>Re: How to access C/C++ objects from Python</title>
	<published>2008-07-16T18:32:45Z</published>
	<updated>2008-07-16T18:32:45Z</updated>
	<author>
		<name>Gregory Propf</name>
	</author>
	<content type="html">&lt;table cellspacing='0' cellpadding='0' border='0'&gt;&lt;tr&gt;&lt;td valign='top' style='font: inherit;'&gt;Thanks,&amp;nbsp; I looked at the code you linked and the wrapper code.&amp;nbsp; If you follow the calls in the code you see that you get to SWIG_TypeQueryModule and that function first looks for the mangled name and then, failing that looks for the unmangled one.&amp;nbsp; In my case though it doesn't seem to work in the latter case.&amp;nbsp; There's some stuff about partial vs. full initializations and I suspect this is the root cause.&lt;br&gt;&lt;br&gt;I also get the impression that the python interpreter called by PyRun_SimpleString doesn't see everything you do with calls to the C API though this doesn't make much sense.&amp;nbsp; For instance just calling PyImport_ImportModule(&quot;mymod&quot;) and&amp;nbsp; PyImport_AddModule(&quot;mymod&quot;) doesn't seem to work, you need to say &quot;import mymod&quot; in the python code too. I'm dynamically linking everything.&amp;nbsp; Is this some linker phenomenon? -
 Greg&lt;br&gt;&lt;br&gt;--- On &lt;b&gt;Wed, 7/16/08, Kai Sterker &lt;i&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18499918&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kai.sterker@...&lt;/a&gt;&amp;gt;&lt;/i&gt;&lt;/b&gt; wrote:&lt;br&gt;&lt;blockquote style=&quot;border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;&quot;&gt;From: Kai Sterker &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18499918&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kai.sterker@...&lt;/a&gt;&amp;gt;&lt;br&gt;Subject: Re: [Swig-user] How to access C/C++ objects from Python&lt;br&gt;To: &quot;SWIG Users&quot; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18499918&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;swig-user@...&lt;/a&gt;&amp;gt;&lt;br&gt;Date: Wednesday, July 16, 2008, 2:22 AM&lt;br&gt;&lt;br&gt;&lt;pre&gt;On Tue, Jul 15, 2008 at 11:23 PM, Gregory Propf &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18499918&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gregorypropf@...&lt;/a&gt;&amp;gt;&lt;br&gt;wrote:&lt;br&gt;&lt;br&gt;&amp;gt; Thanks, that worked but only after I discovered the need to call&lt;br&gt;SWIG_init()&lt;br&gt;&amp;gt; within the C++ program.  If you don't do that the types table entries&lt;br&gt;are&lt;br&gt;&amp;gt; missing and attempting to use something like SWIGTYPE_p_YourCType-&amp;gt;name&lt;br&gt;will&lt;br&gt;&amp;gt; segfault.  I suppose if you know the SWIG type mangling convention you can&lt;br&gt;&amp;gt; get away without it.&lt;br&gt;&lt;br&gt;That wasn't required in our case for some reason. I was
 assuming that&lt;br&gt;SWIG sets up all it needs automatically on importing your Python&lt;br&gt;module with PyImport_ImportModule. But I am not sure how the mechanism&lt;br&gt;works exactly.&lt;br&gt;&lt;br&gt;We use the unmangled name of the C++ class (and namespace) as the name&lt;br&gt;argument (i.e. &quot;base::configuration&quot;) for a class configuration in&lt;br&gt;namespace base.&lt;br&gt;&lt;br&gt;There's also some debugging code that will print the actual classes&lt;br&gt;known to SWIG, but I omitted it for brevity. You can see the whole&lt;br&gt;thing at&lt;br&gt;&lt;br&gt; &lt;br&gt;http://cvs.savannah.gnu.org/viewvc/adonthell/src/py-wrappers/runtime/py_runtime.i?root=adonthell&amp;amp;view=markup&amp;amp;pathrev=HEAD&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; By the way, what did you use for c_owns.  I just used&lt;br&gt;&amp;gt; a 0 after looking at what the other #defines were. - Greg&lt;br&gt;&lt;br&gt;Yes, it's 0.&lt;br&gt;&lt;br&gt;Kai&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move
 Developer's&lt;br&gt;challenge&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp;amp; win great&lt;br&gt;prizes&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world&lt;br&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;amp;url=/&lt;br&gt;_______________________________________________&lt;br&gt;Swig-user mailing list&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18499918&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;&lt;br&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/pre&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;

      &lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18499918&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/How-to-access-C-C%2B%2B-objects-from-Python-tp18459360p18499918.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18486030</id>
	<title>Re: C++ C# struct members and null pointers</title>
	<published>2008-07-16T05:06:26Z</published>
	<updated>2008-07-16T05:06:26Z</updated>
	<author>
		<name>killfish</name>
	</author>
	<content type="html">&lt;br&gt;&amp;gt; I've looked at this and what you would like is what SWIG should
&lt;br&gt;&amp;gt; generated by default. I've fixed it in the svn version, but meanwhile,
&lt;br&gt;&amp;gt; you can just modify your own code using the following typemap:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; %typemap(csdirectorin) SWIGTYPE *
&lt;br&gt;&amp;gt; &amp;quot;($iminput == IntPtr.Zero) ? null : new $csclassname($iminput, false)&amp;quot;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;Thanks a lot, that did the trick.
&lt;br&gt;&lt;br&gt;Regards
&lt;br&gt;Jörg
&lt;br&gt;-- 
&lt;br&gt;Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
&lt;br&gt;Browser-Versionen downloaden: &lt;a href=&quot;http://www.gmx.net/de/go/browser&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.gmx.net/de/go/browser&lt;/a&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18486030&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/C%2B%2B-C--struct-members-and-null-pointers-tp18334283p18486030.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18483662</id>
	<title>Re: How to access C/C++ objects from Python</title>
	<published>2008-07-16T02:22:07Z</published>
	<updated>2008-07-16T02:22:07Z</updated>
	<author>
		<name>Kai Sterker-3</name>
	</author>
	<content type="html">On Tue, Jul 15, 2008 at 11:23 PM, Gregory Propf &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18483662&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gregorypropf@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Thanks, that worked but only after I discovered the need to call SWIG_init()
&lt;br&gt;&amp;gt; within the C++ program. &amp;nbsp;If you don't do that the types table entries are
&lt;br&gt;&amp;gt; missing and attempting to use something like SWIGTYPE_p_YourCType-&amp;gt;name will
&lt;br&gt;&amp;gt; segfault. &amp;nbsp;I suppose if you know the SWIG type mangling convention you can
&lt;br&gt;&amp;gt; get away without it.
&lt;br&gt;&lt;br&gt;That wasn't required in our case for some reason. I was assuming that
&lt;br&gt;SWIG sets up all it needs automatically on importing your Python
&lt;br&gt;module with PyImport_ImportModule. But I am not sure how the mechanism
&lt;br&gt;works exactly.
&lt;br&gt;&lt;br&gt;We use the unmangled name of the C++ class (and namespace) as the name
&lt;br&gt;argument (i.e. &amp;quot;base::configuration&amp;quot;) for a class configuration in
&lt;br&gt;namespace base.
&lt;br&gt;&lt;br&gt;There's also some debugging code that will print the actual classes
&lt;br&gt;known to SWIG, but I omitted it for brevity. You can see the whole
&lt;br&gt;thing at
&lt;br&gt;&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://cvs.savannah.gnu.org/viewvc/adonthell/src/py-wrappers/runtime/py_runtime.i?root=adonthell&amp;view=markup&amp;pathrev=HEAD&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://cvs.savannah.gnu.org/viewvc/adonthell/src/py-wrappers/runtime/py_runtime.i?root=adonthell&amp;view=markup&amp;pathrev=HEAD&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; By the way, what did you use for c_owns. &amp;nbsp;I just used
&lt;br&gt;&amp;gt; a 0 after looking at what the other #defines were. - Greg
&lt;br&gt;&lt;br&gt;Yes, it's 0.
&lt;br&gt;&lt;br&gt;Kai
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18483662&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/How-to-access-C-C%2B%2B-objects-from-Python-tp18459360p18483662.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18475202</id>
	<title>Re: How to access C/C++ objects from Python</title>
	<published>2008-07-15T14:23:05Z</published>
	<updated>2008-07-15T14:23:05Z</updated>
	<author>
		<name>Gregory Propf</name>
	</author>
	<content type="html">&lt;table cellspacing='0' cellpadding='0' border='0'&gt;&lt;tr&gt;&lt;td valign='top' style='font: inherit;'&gt;Thanks, that worked but only after I discovered the need to call SWIG_init() within the C++ program.&amp;nbsp; If you don't do that the types table entries are missing and attempting to use something like SWIGTYPE_p_YourCType-&amp;gt;name will segfault.&amp;nbsp; I suppose if you know the SWIG type mangling convention you can get away without it.&amp;nbsp; By the way, what did you use for c_owns.&amp;nbsp; I just used a 0 after looking at what the other #defines were. - Greg&lt;br&gt;&lt;br&gt;&amp;nbsp;&lt;br&gt;--- On &lt;b&gt;Tue, 7/15/08, Kai Sterker &lt;i&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18475202&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kai.sterker@...&lt;/a&gt;&amp;gt;&lt;/i&gt;&lt;/b&gt; wrote:&lt;br&gt;&lt;blockquote style=&quot;border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;&quot;&gt;From: Kai Sterker &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18475202&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kai.sterker@...&lt;/a&gt;&amp;gt;&lt;br&gt;Subject: Re: [Swig-user] How to access C/C++ objects from Python&lt;br&gt;To: &quot;SWIG Users&quot; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18475202&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;swig-user@...&lt;/a&gt;&amp;gt;&lt;br&gt;Date: Tuesday, July 15, 2008,
 3:07 AM&lt;br&gt;&lt;br&gt;&lt;pre&gt;On Tue, Jul 15, 2008 at 9:59 AM, Gregory Propf &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18475202&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gregorypropf@...&lt;/a&gt;&amp;gt;&lt;br&gt;wrote:&lt;br&gt;&lt;br&gt;&amp;gt; Here I go replying to my own post again but I need to clarify something.&lt;br&gt;&amp;gt; The basic point (heh,punny) of all this pointer nonsense is to create an&lt;br&gt;&amp;gt; object in a C++ program and ship it into Python to be acted on there using&lt;br&gt;a&lt;br&gt;&amp;gt; script.  The object has a SWIG wrapper.  That's the basic goal.&lt;br&gt;&lt;br&gt;Not sure if this is exactly what you want, but it sounds somewhat&lt;br&gt;similar to what we are doing. That is, calling a Python script (or&lt;br&gt;method) from C++ and passing in a C++ object that has been wrapped by&lt;br&gt;SWIG. It looks something like this:&lt;br&gt;&lt;br&gt;   PyObject *result = PyObject_CallObject (Method, Args);&lt;br&gt;&lt;br&gt;where Method is a PyCallable object and Args a PyTuple containing&lt;br&gt;wrapped C++ objects. The wrapping itself goes like this:&lt;br&gt;&lt;br&gt;   template &amp;lt;class A&amp;gt; inline&lt;br&gt;   PyObject * pass_instance(A arg,
 const char *type_name, const&lt;br&gt;ownership own = c_owns)&lt;br&gt;   {&lt;br&gt;       return cxx_to_py ((void *) arg, type_name, own);&lt;br&gt;   }&lt;br&gt;&lt;br&gt;   SWIGEXPORT PyObject *cxx_to_py (void *instance, const char *name,&lt;br&gt;const bool &amp;amp; ownership)&lt;br&gt;   {&lt;br&gt;       if (SWIG_Python_GetModule())&lt;br&gt;       {&lt;br&gt;           swig_type_info * tt = SWIG_Python_TypeQuery (name);&lt;br&gt;           if (tt) return SWIG_NewPointerObj (instance, tt, ownership);&lt;br&gt;&lt;br&gt;           fprintf (stderr, &quot;*** cxx_to_py: '%s' not found.&lt;br&gt;&quot;, name);&lt;br&gt;       }&lt;br&gt;       else&lt;br&gt;       {&lt;br&gt;           fprintf (stderr, &quot;*** cxx_to_py: no Python module&lt;br&gt;imported!\n&quot;);&lt;br&gt;       }&lt;br&gt;&lt;br&gt;       return NULL;&lt;br&gt;   }&lt;br&gt;&lt;br&gt;Since cxx_to_py needs access to SWIG internals, it is part of the SWIG&lt;br&gt;interface file (and therefore needs some changes from time to time as&lt;br&gt;the SWIG internals change).&lt;br&gt;&lt;br&gt;&lt;br&gt;Hope that's fitting your
 case.&lt;br&gt;&lt;br&gt;Kai&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's&lt;br&gt;challenge&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp;amp; win great&lt;br&gt;prizes&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world&lt;br&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;amp;url=/&lt;br&gt;_______________________________________________&lt;br&gt;Swig-user mailing list&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18475202&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;&lt;br&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/pre&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;

      &lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18475202&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/How-to-access-C-C%2B%2B-objects-from-Python-tp18459360p18475202.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18461777</id>
	<title>Re: How to access C/C++ objects from Python</title>
	<published>2008-07-15T03:07:58Z</published>
	<updated>2008-07-15T03:07:58Z</updated>
	<author>
		<name>Kai Sterker-3</name>
	</author>
	<content type="html">On Tue, Jul 15, 2008 at 9:59 AM, Gregory Propf &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18461777&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gregorypropf@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Here I go replying to my own post again but I need to clarify something.
&lt;br&gt;&amp;gt; The basic point (heh,punny) of all this pointer nonsense is to create an
&lt;br&gt;&amp;gt; object in a C++ program and ship it into Python to be acted on there using a
&lt;br&gt;&amp;gt; script. &amp;nbsp;The object has a SWIG wrapper. &amp;nbsp;That's the basic goal.
&lt;br&gt;&lt;br&gt;Not sure if this is exactly what you want, but it sounds somewhat
&lt;br&gt;similar to what we are doing. That is, calling a Python script (or
&lt;br&gt;method) from C++ and passing in a C++ object that has been wrapped by
&lt;br&gt;SWIG. It looks something like this:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;PyObject *result = PyObject_CallObject (Method, Args);
&lt;br&gt;&lt;br&gt;where Method is a PyCallable object and Args a PyTuple containing
&lt;br&gt;wrapped C++ objects. The wrapping itself goes like this:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;template &amp;lt;class A&amp;gt; inline
&lt;br&gt;&amp;nbsp; &amp;nbsp;PyObject * pass_instance(A arg, const char *type_name, const
&lt;br&gt;ownership own = c_owns)
&lt;br&gt;&amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return cxx_to_py ((void *) arg, type_name, own);
&lt;br&gt;&amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;SWIGEXPORT PyObject *cxx_to_py (void *instance, const char *name,
&lt;br&gt;const bool &amp; ownership)
&lt;br&gt;&amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (SWIG_Python_GetModule())
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;swig_type_info * tt = SWIG_Python_TypeQuery (name);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (tt) return SWIG_NewPointerObj (instance, tt, ownership);
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fprintf (stderr, &amp;quot;*** cxx_to_py: '%s' not found. &amp;quot;, name);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fprintf (stderr, &amp;quot;*** cxx_to_py: no Python module imported!\n&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return NULL;
&lt;br&gt;&amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;Since cxx_to_py needs access to SWIG internals, it is part of the SWIG
&lt;br&gt;interface file (and therefore needs some changes from time to time as
&lt;br&gt;the SWIG internals change).
&lt;br&gt;&lt;br&gt;&lt;br&gt;Hope that's fitting your case.
&lt;br&gt;&lt;br&gt;Kai
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18461777&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/How-to-access-C-C%2B%2B-objects-from-Python-tp18459360p18461777.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18459913</id>
	<title>Re: How to access C/C++ objects from Python</title>
	<published>2008-07-15T00:59:36Z</published>
	<updated>2008-07-15T00:59:36Z</updated>
	<author>
		<name>Gregory Propf</name>
	</author>
	<content type="html">&lt;table cellspacing='0' cellpadding='0' border='0'&gt;&lt;tr&gt;&lt;td valign='top' style='font: inherit;'&gt;Here I go replying to my own post again but I need to clarify something.&amp;nbsp; The basic point (heh,punny) of all this pointer nonsense is to create an object in a C++ program and ship it into Python to be acted on there using a script.&amp;nbsp; The object has a SWIG wrapper.&amp;nbsp; That's the basic goal.&amp;nbsp; - Greg&lt;br&gt;&lt;br&gt;--- On &lt;b&gt;Tue, 7/15/08, Gregory Propf &lt;i&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18459913&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gregorypropf@...&lt;/a&gt;&amp;gt;&lt;/i&gt;&lt;/b&gt; wrote:&lt;br&gt;&lt;blockquote style=&quot;border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;&quot;&gt;From: Gregory Propf &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18459913&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gregorypropf@...&lt;/a&gt;&amp;gt;&lt;br&gt;Subject: [Swig-user] How to access C/C++ objects from Python&lt;br&gt;To: &quot;SWIG Users&quot; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18459913&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;swig-user@...&lt;/a&gt;&amp;gt;&lt;br&gt;Date: Tuesday, July 15, 2008, 12:14 AM&lt;br&gt;&lt;br&gt;&lt;div id=&quot;yiv1363817871&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;font-family: inherit; font-style: inherit;
 font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; -x-system-font: none;&quot; valign=&quot;top&quot;&gt;I have a C++ library that is wrapped using SWIG.&amp;nbsp; There is a static pointer in this library that I want to be able to set in a C++ program's main function and then get access to from Python.&amp;nbsp; I've tried setting the pointer in the C++ program and then using PyRun_SimpleString to run Python code that looks at it.&amp;nbsp; The problem is that the pointer does seem to be set when viewed from the Python code.&amp;nbsp; I'm assuming this is some linking issue.&amp;nbsp; Perhaps if I linked everything statically?&amp;nbsp; But I don't know how to do that. - Greg&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;

      &lt;/div&gt;&lt;pre&gt;-------------------------------------------------------------------------&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's&lt;br&gt;challenge&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp;amp; win great&lt;br&gt;prizes&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world&lt;br&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;amp;url=/&lt;/pre&gt;&lt;pre&gt;_______________________________________________&lt;br&gt;Swig-user mailing list&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18459913&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;&lt;br&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/pre&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;

      &lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18459913&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/How-to-access-C-C%2B%2B-objects-from-Python-tp18459360p18459913.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18459360</id>
	<title>How to access C/C++ objects from Python</title>
	<published>2008-07-15T00:14:38Z</published>
	<updated>2008-07-15T00:14:38Z</updated>
	<author>
		<name>Gregory Propf</name>
	</author>
	<content type="html">&lt;table cellspacing='0' cellpadding='0' border='0'&gt;&lt;tr&gt;&lt;td valign='top' style='font: inherit;'&gt;I have a C++ library that is wrapped using SWIG.&amp;nbsp; There is a static pointer in this library that I want to be able to set in a C++ program's main function and then get access to from Python.&amp;nbsp; I've tried setting the pointer in the C++ program and then using PyRun_SimpleString to run Python code that looks at it.&amp;nbsp; The problem is that the pointer does seem to be set when viewed from the Python code.&amp;nbsp; I'm assuming this is some linking issue.&amp;nbsp; Perhaps if I linked everything statically?&amp;nbsp; But I don't know how to do that. - Greg&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;

      &lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18459360&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/How-to-access-C-C%2B%2B-objects-from-Python-tp18459360p18459360.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18454045</id>
	<title>Re: C++ C# struct members and null pointers</title>
	<published>2008-07-14T14:52:39Z</published>
	<updated>2008-07-14T14:52:39Z</updated>
	<author>
		<name>wsfulton</name>
	</author>
	<content type="html">&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18454045&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;killfish@...&lt;/a&gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Additional info, the NULL pointer comes in through a director: 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; private void SwigDirectorMyClassReceived(IntPtr _infos, int _resultcode) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; MyClassReceived(new MyClass(_infos, false), (eError)_resultcode);
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Is there a way to pass a null-pointer to MyClassReceived() instead of an 
&lt;br&gt;&amp;gt; instance of MyClass with a null-Pointer as internal &amp;nbsp;handle? 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;I've looked at this and what you would like is what SWIG should
&lt;br&gt;generated by default. I've fixed it in the svn version, but meanwhile,
&lt;br&gt;you can just modify your own code using the following typemap:
&lt;br&gt;&lt;br&gt;%typemap(csdirectorin) SWIGTYPE *
&lt;br&gt;&amp;quot;($iminput == IntPtr.Zero) ? null : new $csclassname($iminput, false)&amp;quot;
&lt;br&gt;&lt;br&gt;William
&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18454045&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/C%2B%2B-C--struct-members-and-null-pointers-tp18334283p18454045.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18453365</id>
	<title>Re: c# wrapping and DllImport attribute's CharSet field</title>
	<published>2008-07-14T14:02:00Z</published>
	<updated>2008-07-14T14:02:00Z</updated>
	<author>
		<name>wsfulton</name>
	</author>
	<content type="html">Antti Karanta wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Hi!
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;I have been using swig to generate Java wrappers for some years. Now I &amp;nbsp;
&lt;br&gt;&amp;gt; am using swig to integrate native code with c#.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;The first issue I ran into is passing strings. I have an API that &amp;nbsp;
&lt;br&gt;&amp;gt; expects UTF-8 encoded strings and unfortunately this does not seem to be &amp;nbsp;
&lt;br&gt;&amp;gt; supported out-of-the-box by .NET P/Invoke. The approach I took is to pass &amp;nbsp;
&lt;br&gt;&amp;gt; in the string as UTF-16 to the native side and do the conversion to UTF-8 &amp;nbsp;
&lt;br&gt;&amp;gt; on the c side by defining appropriate typemaps (I have the necessary c &amp;nbsp;
&lt;br&gt;&amp;gt; functions to convert from utf-16 to utf-8).
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Defining the appropriate typemaps is easy enough, but as the CharSet &amp;nbsp;
&lt;br&gt;&amp;gt; field of DllImport attribute seems to default to CharSet.Ansi, I'd need to &amp;nbsp;
&lt;br&gt;&amp;gt; be able to make swig set that field to CharSet.Unicode. I looked at the c# &amp;nbsp;
&lt;br&gt;&amp;gt; swig documenation (&lt;a href=&quot;http://www.swig.org/Doc1.3/CSharp.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.swig.org/Doc1.3/CSharp.html&lt;/a&gt;), but could find &amp;nbsp;
&lt;br&gt;&amp;gt; nothing about how to affect the CharSet field of DllImport. Is it &amp;nbsp;
&lt;br&gt;&amp;gt; supported?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Setting attributes for individual parameters seems to be supported in &amp;nbsp;
&lt;br&gt;&amp;gt; the imtype typemap, so I guess this should do the trick:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; %typemap(imtype, inattributes=&amp;quot;[MarshalAs(UnmanagedType.LPWStr)]&amp;quot;)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Am I on the right track? Or is there a better way to swig wrap UTF-8 &amp;nbsp;
&lt;br&gt;&amp;gt; string parameters?
&lt;br&gt;&amp;gt; 
&lt;/div&gt;Yes, I thnnk so!
&lt;br&gt;&lt;br&gt;William
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18453365&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/c--wrapping-and-DllImport-attribute%27s-CharSet-field-tp18312338p18453365.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18453154</id>
	<title>Re: using inttypes.h</title>
	<published>2008-07-14T14:01:43Z</published>
	<updated>2008-07-14T14:01:43Z</updated>
	<author>
		<name>wsfulton</name>
	</author>
	<content type="html">hannit wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi
&lt;br&gt;&amp;gt; my functions use types such as uint32, uint16, etc ...
&lt;br&gt;&amp;gt; all are defined in an internal h file with the following code:
&lt;br&gt;&amp;gt; typedef int8_t &amp;nbsp; &amp;nbsp;int8;
&lt;br&gt;&amp;gt; typedef int16_t &amp;nbsp; int16;
&lt;br&gt;&amp;gt; typedef int32_t &amp;nbsp; int32;
&lt;br&gt;&amp;gt; typedef int64_t &amp;nbsp; int64;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; typedef uint8_t &amp;nbsp; &amp;nbsp;uint8;
&lt;br&gt;&amp;gt; typedef uint16_t &amp;nbsp; uint16;
&lt;br&gt;&amp;gt; typedef uint32_t &amp;nbsp; uint32;
&lt;br&gt;&amp;gt; typedef uint64_t &amp;nbsp; uint64;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; in the interface file I wrote the following:
&lt;br&gt;&amp;gt; %module myModule
&lt;br&gt;&amp;gt; %{
&lt;br&gt;&amp;gt; #include &amp;lt;inttypes.h&amp;gt;
&lt;br&gt;&amp;gt; #include &amp;quot;defines.h&amp;quot;
&lt;br&gt;&amp;gt; #include &amp;quot;Module1.h&amp;quot;
&lt;br&gt;&amp;gt; #include &amp;quot;Module2.h&amp;quot;
&lt;br&gt;&amp;gt; %}
&lt;br&gt;&amp;gt; %include &amp;lt;inttypes.h&amp;gt;
&lt;br&gt;&amp;gt; %include &amp;quot;defines.h&amp;quot;
&lt;br&gt;&amp;gt; %include &amp;quot;Module1.h&amp;quot;
&lt;br&gt;&amp;gt; %include &amp;quot;Module2.h&amp;quot;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I've added inttypes since I understand swig does not know to use it if not
&lt;br&gt;&amp;gt; included.
&lt;br&gt;&amp;gt; When trying to apply swig -c++ -python mymodule.i
&lt;br&gt;&amp;gt; I get the following error:
&lt;br&gt;&amp;gt; mymodule.i:9: Error: Unable to find 'inttypes.h'
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; (which applies for the line %include &amp;lt;inttypes.h&amp;gt;)
&lt;br&gt;&amp;gt; When I remove the line swig does not recognize my types and returns
&lt;br&gt;&amp;gt; Py_Object* instead of uint32
&lt;br&gt;&amp;gt; An advice would be appriciated.
&lt;br&gt;&amp;gt; Hannit
&lt;br&gt;&amp;gt; 
&lt;/div&gt;I'd check to see if this is clashing with inttypes.i and stdint.i 
&lt;br&gt;included with swig or if they are not included by default, you can add 
&lt;br&gt;them in explicitly. Run swig -E to see what headers it is including.
&lt;br&gt;&lt;br&gt;William
&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18453154&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/using-inttypes.h-tp18180923p18453154.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18453126</id>
	<title>Re: Problems with map and typedef</title>
	<published>2008-07-14T14:00:12Z</published>
	<updated>2008-07-14T14:00:12Z</updated>
	<author>
		<name>wsfulton</name>
	</author>
	<content type="html">aldisp wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm trying to generate some code which has both template types and typedefs
&lt;br&gt;&amp;gt; and it seems to be confusing swig, me and/or both! I'm targetting c# at the
&lt;br&gt;&amp;gt; mo. I'm running swig using this command:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;quot;c:\program files\swig\swigwin-1.3.36\swig&amp;quot; -csharp -namespace Test -o
&lt;br&gt;&amp;gt; SWIG_wrap.cxx -outdir .\output -c++ -module TestDll test.i
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; test.i consists of:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; %{
&lt;br&gt;&amp;gt; #include &amp;lt;map&amp;gt;
&lt;br&gt;&amp;gt; #include &amp;lt;vector&amp;gt;
&lt;br&gt;&amp;gt; %}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; %include stl.i
&lt;br&gt;&amp;gt; %include &amp;quot;std_map.i&amp;quot;
&lt;br&gt;&amp;gt; %include &amp;quot;std_vector.i&amp;quot;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; %template(DoubleVector) std::vector&amp;lt;double&amp;gt;;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; typedef std::map&amp;lt; int, std::vector&amp;lt;double&amp;gt; &amp;gt; CdoIntegGrid_t;
&lt;br&gt;&amp;gt; typedef std::vector&amp;lt; CdoIntegGrid_t &amp;gt; CdoIntegGridVect_t;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; %template(DateDoubleVectorMap) std::map&amp;lt; int, std::vector&amp;lt;double&amp;gt; &amp;gt;;
&lt;br&gt;&amp;gt; %template(CdoIntegGridVector) std::vector&amp;lt; CdoIntegGrid_t &amp;gt;;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; class kbCLossBaskets
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; public:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; static std::vector&amp;lt;double&amp;gt; SimpleMethod(const std::vector&amp;lt;double&amp;gt;&amp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; coupons,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CdoIntegGridVect_t * &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; aFixedGrid=NULL);
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; };
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The problem is that the generated files include a class called
&lt;br&gt;&amp;gt; CdoIntegGridVector, which you woudl hope is a vector of DateDoubleVectorMap,
&lt;br&gt;&amp;gt; but in fact it puts out code like this:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; public std::map&amp;lt; int,std::vector&amp;lt; double &amp;gt; &amp;gt; this[int index] &amp;nbsp;{
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; get {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; return getitem(index);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; set {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; setitem(index, value);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I have a feeling it may be related to this, but wasn't wholly sure....
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.nabble.com/Problems-with-Std%3A%3AMap-and-Templates-td6219519.html#a6219519&quot; target=&quot;_top&quot;&gt;http://www.nabble.com/Problems-with-Std%3A%3AMap-and-Templates-td6219519.html#a6219519&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Would greatly appreciate some help for this...
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;Please look at the comments at the top of the csharp/std_vector.i file 
&lt;br&gt;and use one of the SPECIALIZE macros.
&lt;br&gt;&lt;br&gt;William
&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18453126&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Problems-with-map-and-typedef-tp18314488p18453126.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18453120</id>
	<title>Re: Strange issue with 1.3.36</title>
	<published>2008-07-14T13:59:41Z</published>
	<updated>2008-07-14T13:59:41Z</updated>
	<author>
		<name>wsfulton</name>
	</author>
	<content type="html">&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18453120&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Cooper_JohnD@...&lt;/a&gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello William,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks for the advice I remove the std imports. But still get a similar
&lt;br&gt;&amp;gt; error:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Running : C:\swigwin-1.3.36\swig -Wall -c++ -java -package
&lt;br&gt;&amp;gt; com.emc.cst.cstBridge -module cstBridge -IX:\include -IX:\common
&lt;br&gt;&amp;gt; -IX:\C_library\include -IX:\data -IX:\services -IX:\managers -IX:\
&lt;br&gt;&amp;gt; -IC:\swigwin-1.3.36\Lib\java -IC:\swigwin-1.3.36\Lib -outdir
&lt;br&gt;&amp;gt; J:\cst\cstBridge -o
&lt;br&gt;&amp;gt; c:\cst-Dev\dev\src\com\emc\csp\common\swigInterfaces\cst_wrap.cpp -oh
&lt;br&gt;&amp;gt; c:\cst-Dev\dev\src\com\emc\csp\common\swigInterfaces\cst.h
&lt;br&gt;&amp;gt; &amp;quot;c:\cst-Dev\dev\src\com\emc\csp\common\swigInterfaces\cst.i&amp;quot;
&lt;br&gt;&amp;gt; X:\common\swigInterfaces\base.i(19): Error: Syntax error in input(1).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; SwigGen Complete!
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Here are the relevant line of base.i
&lt;br&gt;&amp;gt; &amp;nbsp;1: // Swig Inerface file for building bridging code between C++ and
&lt;br&gt;&amp;gt; Java
&lt;br&gt;&amp;gt; &amp;nbsp;2:
&lt;br&gt;&amp;gt; &amp;nbsp;3: %insert(&amp;quot;runtime&amp;quot;) %{
&lt;br&gt;&amp;gt; &amp;nbsp;4: #define AttachCurrentThread AttachCurrentThreadAsDaemon
&lt;br&gt;&amp;gt; &amp;nbsp;5: %}
&lt;br&gt;&amp;gt; &amp;nbsp;6: // define the module name
&lt;br&gt;&amp;gt; &amp;nbsp;7: %module(directors=&amp;quot;1&amp;quot;) cspBridge
&lt;br&gt;&amp;gt; &amp;nbsp;8:
&lt;br&gt;&amp;gt; &amp;nbsp;9: // Boilerplate code to load the CSP.dll
&lt;br&gt;&amp;gt; 10:
&lt;br&gt;&amp;gt; 11:
&lt;br&gt;&amp;gt; 12: %define SWIG_EXPORT_ITERATOR_METHODS
&lt;br&gt;&amp;gt; 13: %enddef
&lt;/div&gt;Java doesn't support this, so I'd remove it.
&lt;br&gt;&lt;br&gt;&amp;gt; 14:
&lt;br&gt;&amp;gt; 15: %import &amp;quot;cpointer.i&amp;quot;
&lt;br&gt;&amp;gt; 16:
&lt;br&gt;&amp;gt; 17: %import &amp;quot;java/typemaps.i&amp;quot;
&lt;br&gt;&amp;gt; 18: %import &amp;quot;java/various.i&amp;quot;
&lt;br&gt;&amp;gt; 19: %import &amp;quot;java/stl.i&amp;quot;
&lt;br&gt;&amp;gt; 20: %import &amp;quot;java/arrays_java.i&amp;quot;
&lt;br&gt;&amp;gt; 21:
&lt;br&gt;These should be using %include rather than %import and the java prefix
&lt;br&gt;should not be required. Long shot, but maybe you have a java
&lt;br&gt;subdirectory in one of your include patsh.
&lt;br&gt;&lt;br&gt;&amp;gt; 22: %ignore CSP::EXCEPTIONS::IExceptionData
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Any suggestions would greatly appriacted.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; John
&lt;br&gt;&amp;gt; 
&lt;br&gt;Other than that, I'd comment out bits of code until you can get it to
&lt;br&gt;work and that should point to the problem area.
&lt;br&gt;&lt;br&gt;William
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; -----Original Message-----
&lt;br&gt;&amp;gt;&amp;gt; From: William Fulton [mailto:&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18453120&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;william@...&lt;/a&gt;] On Behalf Of
&lt;br&gt;&amp;gt;&amp;gt; William S Fulton
&lt;br&gt;&amp;gt;&amp;gt; Sent: Thursday, July 03, 2008 5:34 PM
&lt;br&gt;&amp;gt;&amp;gt; To: Cooper, JohnD
&lt;br&gt;&amp;gt;&amp;gt; Cc: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18453120&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;swig-user@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt; Subject: Re: [Swig-user] Strange issue with 1.3.36
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18453120&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Cooper_JohnD@...&lt;/a&gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Hello All,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Just download 1.3.36 for some of the Java fixes, but when I try to
&lt;br&gt;&amp;gt; use
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; it against our current rule set, mind you none of our rules have
&lt;br&gt;&amp;gt; changed
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; between 1.3.31 which works and 1.3.36 which does not, I get the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; following error:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Running : M:\src\make\..\..\src\thirdparty\swigwin-1.3.36\swig
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; -Fmicrosoft -Wall -c++ -java -package com.emc.cst.cstBridge -module
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; cstBridge -IX:\include -IX:\common -IX:\C_library\include -IX:\data
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; -IX:\services -IX:\managers -IX:\
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; -IM:\src\make\..\..\src\thirdparty\swigwin-1.3.36\Lib\java
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; -IM:\src\make\..\..\src\thirdparty\swigwin-1.3.36\Lib -outdir
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; J:\cst\cstBridge -o
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; m:\src\com\emc\csp\common\swigInterfaces\cst_wrap.cpp -oh
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; m:\src\com\emc\csp\common\swigInterfaces\cst.h
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;quot;m:\src\com\emc\csp\common\swigInterfaces\cst.i&amp;quot;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; M:\src\make\..\..\src\thirdparty\swigwin-1.3.36\Lib\std\std_list.i(78):
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Error: Syntax error in input(3).
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; SwigGen Complete!
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Can anyone shed any light on what might be causing this?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Java doesn't use Lib/std/std_list.i. Are you explicitly including it?
&lt;br&gt;&amp;gt;&amp;gt; Running swig with the -v option should print out the search paths it
&lt;br&gt;&amp;gt; is
&lt;br&gt;&amp;gt;&amp;gt; considering and that should not include Lib/std. The files in std are
&lt;br&gt;&amp;gt;&amp;gt; not designed for use with java, so if you are explicitly including
&lt;br&gt;&amp;gt;&amp;gt; std/std_list.i, you are going to have to think of something else, like
&lt;br&gt;&amp;gt;&amp;gt; use an older version perhaps?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; William
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18453120&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Strange-issue-with-1.3.36-tp18262470p18453120.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18453100</id>
	<title>Re: Premature GC flag (pgcppname) not working (JAVA)</title>
	<published>2008-07-14T13:58:09Z</published>
	<updated>2008-07-14T13:58:09Z</updated>
	<author>
		<name>wsfulton</name>
	</author>
	<content type="html">GtG wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I am using Swig version 1.3.35 to wrap a C++ api. But unfortunately I 
&lt;br&gt;&amp;gt; was unable to activate the pgcppname flag used in javain typemaps as in 
&lt;br&gt;&amp;gt; the following example:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; %typemap (javain,pgcppname=&amp;quot;$javainput&amp;quot;) void * 
&lt;br&gt;&amp;gt; &amp;quot;$imclassname.ObjectPool().getObjectUID($javainput)&amp;quot;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The flag seems to have no effect to the generated code and no warnings 
&lt;br&gt;&amp;gt; given in the output.
&lt;br&gt;&amp;gt; Is there anyone else who has encountered a similar problem or am I doing 
&lt;br&gt;&amp;gt; something wrong?
&lt;br&gt;&amp;gt; 
&lt;/div&gt;Not sure just from the small snippet of code you give. Have you tried
&lt;br&gt;taking a working example and modifying that? Take a look at
&lt;br&gt;Examples/test-suite/java_prepost.i or get the Date example in the
&lt;br&gt;documentation working first.
&lt;br&gt;&lt;br&gt;William
&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18453100&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Premature-GC-flag-%28pgcppname%29-not-working-%28JAVA%29-tp18378662p18453100.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18453104</id>
	<title>Re: swig + doxygen</title>
	<published>2008-07-14T13:57:52Z</published>
	<updated>2008-07-14T13:57:52Z</updated>
	<author>
		<name>wsfulton</name>
	</author>
	<content type="html">Patrick wrote:
&lt;br&gt;&amp;gt; Is anyone else using doxygen xml output to dynamically create interface 
&lt;br&gt;&amp;gt; files ? &amp;nbsp;I wrote something to generate interface files, but its still 
&lt;br&gt;&amp;gt; kind of rough around the edges, i was wondering if anyone else is 
&lt;br&gt;&amp;gt; pursuing the same path?
&lt;br&gt;&amp;gt; 
&lt;br&gt;What kind of functionality are you using doxygen for and what do you get
&lt;br&gt;it to put into the interface files?
&lt;br&gt;&lt;br&gt;William
&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18453104&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/swig-%2B-doxygen-tp18409118p18453104.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18437897</id>
	<title>Re: Premature GC flag (pgcppname) not working (JAVA)</title>
	<published>2008-07-13T22:57:25Z</published>
	<updated>2008-07-13T22:57:25Z</updated>
	<author>
		<name>GtG-2</name>
	</author>
	<content type="html">Is nobody ever used the pgcppname flag?&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Jul 10, 2008 at 11:57 AM, GtG &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18437897&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gokdoga.n@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Hi,&lt;br&gt;&lt;br&gt;I am using Swig version 1.3.35 to wrap a C++ api. But
unfortunately I was unable to activate the pgcppname flag used in
javain typemaps as in the following example:&lt;br&gt;&lt;br&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;%typemap (javain,pgcppname=&amp;quot;$javainput&amp;quot;) void * &amp;quot;$imclassname.ObjectPool().getObjectUID($javainput)&amp;quot;&lt;/span&gt;&lt;br&gt;



&lt;br&gt;The flag seems to have no effect to the generated code and no warnings given in the output.&lt;br&gt;Is there anyone else who has encountered a similar problem or am I doing something wrong?&lt;br&gt;&lt;br&gt;Thanks in advance,&lt;br&gt;&lt;br&gt;



Goktug
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18437897&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Premature-GC-flag-%28pgcppname%29-not-working-%28JAVA%29-tp18378662p18437897.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18418898</id>
	<title>Re: Downcasting in Python wrappers?</title>
	<published>2008-07-12T05:03:50Z</published>
	<updated>2008-07-12T05:03:50Z</updated>
	<author>
		<name>nitro-4</name>
	</author>
	<content type="html">Am 12.07.2008, 13:44 Uhr, schrieb Kai Sterker &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18418898&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kai.sterker@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I'm using SWIG to generate Python wrappers and have run into the
&lt;br&gt;&amp;gt; following issue.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have a C++ base class and derived from that several other classes,
&lt;br&gt;&amp;gt; each with its own distinct set of methods. Another class stores
&lt;br&gt;&amp;gt; instances of the derived classes and has a method get_base() that
&lt;br&gt;&amp;gt; returns a specific instance.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Now, on Python side, I am getting a base instance by calling
&lt;br&gt;&amp;gt; get_base(), but would like to use it to invoke methods of derived_a.
&lt;br&gt;&amp;gt; However, I see now way to cast the base instance into a derived_a
&lt;br&gt;&amp;gt; instance.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; What I did as a workaround is adding the following to my interface file:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; %extend xyz {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; derived_a* get_derived_a (const std::string &amp; name)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return dynamic_cast&amp;lt;derived_a*&amp;gt; (self-&amp;gt;get_base (name));
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; };
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; However, I would have to do that for every derived_&amp;lt;x&amp;gt; which is not
&lt;br&gt;&amp;gt; very elegant.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Does SWIG provide a better way to handle something like this?
&lt;/div&gt;&lt;br&gt;There's the swig/lib/typemaps/factory.swg file which does more or less &amp;nbsp;
&lt;br&gt;what you suggest. To use it write %include factory.i .
&lt;br&gt;&lt;br&gt;-Matthias
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18418898&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Downcasting-in-Python-wrappers--tp18418751p18418898.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18418751</id>
	<title>Downcasting in Python wrappers?</title>
	<published>2008-07-12T04:44:46Z</published>
	<updated>2008-07-12T04:44:46Z</updated>
	<author>
		<name>Kai Sterker-3</name>
	</author>
	<content type="html">I'm using SWIG to generate Python wrappers and have run into the
&lt;br&gt;following issue.
&lt;br&gt;&lt;br&gt;I have a C++ base class and derived from that several other classes,
&lt;br&gt;each with its own distinct set of methods. Another class stores
&lt;br&gt;instances of the derived classes and has a method get_base() that
&lt;br&gt;returns a specific instance.
&lt;br&gt;&lt;br&gt;Now, on Python side, I am getting a base instance by calling
&lt;br&gt;get_base(), but would like to use it to invoke methods of derived_a.
&lt;br&gt;However, I see now way to cast the base instance into a derived_a
&lt;br&gt;instance.
&lt;br&gt;&lt;br&gt;What I did as a workaround is adding the following to my interface file:
&lt;br&gt;&lt;br&gt;%extend xyz {
&lt;br&gt;&amp;nbsp; &amp;nbsp; derived_a* get_derived_a (const std::string &amp; name)
&lt;br&gt;&amp;nbsp; &amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return dynamic_cast&amp;lt;derived_a*&amp;gt; (self-&amp;gt;get_base (name));
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;};
&lt;br&gt;&lt;br&gt;However, I would have to do that for every derived_&amp;lt;x&amp;gt; which is not
&lt;br&gt;very elegant.
&lt;br&gt;&lt;br&gt;Does SWIG provide a better way to handle something like this?
&lt;br&gt;&lt;br&gt;Kai
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18418751&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Downcasting-in-Python-wrappers--tp18418751p18418751.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18415107</id>
	<title>Re: Debugging SWIG modules</title>
	<published>2008-07-11T18:33:48Z</published>
	<updated>2008-07-11T18:33:48Z</updated>
	<author>
		<name>Gregory Propf</name>
	</author>
	<content type="html">&lt;table cellspacing='0' cellpadding='0' border='0'&gt;&lt;tr&gt;&lt;td valign='top' style='font: inherit;'&gt;Thanks, that worked but I would like to be able to step through the extension code and look at pointer values, etc... - Greg&lt;br&gt;&lt;br&gt;--- On &lt;b&gt;Fri, 7/11/08, Georgios Petasis &lt;i&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18415107&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;petasisg@...&lt;/a&gt;&amp;gt;&lt;/i&gt;&lt;/b&gt; wrote:&lt;br&gt;&lt;blockquote style=&quot;border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;&quot;&gt;From: Georgios Petasis &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18415107&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;petasisg@...&lt;/a&gt;&amp;gt;&lt;br&gt;Subject: Re: [Swig-user] Debugging SWIG modules&lt;br&gt;To: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18415107&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gregorypropf@...&lt;/a&gt;&lt;br&gt;Cc: &quot;SWIG Users&quot; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18415107&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;swig-user@...&lt;/a&gt;&amp;gt;&lt;br&gt;Date: Friday, July 11, 2008, 3:17 AM&lt;br&gt;&lt;br&gt;&lt;div id=&quot;yiv1981277416&quot;&gt;


  
There are several options :-)&lt;br&gt;
&lt;br&gt;
First of all if you manage to build your extension in debug mode but
link with a non debug python library, it will also work.&lt;br&gt;
If you don't manage to link in such a way, then you need to recompile
python to build a debug binary.&lt;br&gt;
&lt;br&gt;
Then you start gdb, with the path to the python interpreter as an
argument.&lt;br&gt;
&lt;br&gt;
When inside gdb, type:&lt;br&gt;
&lt;br&gt;
run &amp;lt;path_to_your_python_script_that_loads_your_extension&amp;gt;&lt;br&gt;
&lt;br&gt;
Then, interact with python, until you get the crash. Once you have the
crash, type in gdb:&lt;br&gt;
&lt;br&gt;
where&lt;br&gt;
&lt;br&gt;
This will give you the stack trace.&lt;br&gt;
&lt;br&gt;
George&lt;br&gt;
&lt;br&gt;
O/H Gregory Propf έγραψε:
&lt;blockquote type=&quot;cite&quot;&gt;
  &lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;&quot; valign=&quot;top&quot;&gt;I'm a newbie to SWIG and I'm trying to find the source of
some segfaults in a typemap of mine.&amp;nbsp; I'm a little confused about how
to do this with gdb, with which I am only passingly familiar as well.&amp;nbsp;
This is on Linux of course.&amp;nbsp; I know how to start an executable in the
debugger but here we have a python interpreter and loadable modules on
top of that.&amp;nbsp; I suppose I could just rebuild python itself with the
debugging symbols included but does gdb know how to follow dynamically
loaded modules? - Greg&lt;br&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;br&gt;
  &lt;pre&gt;&lt;hr size=&quot;4&quot; width=&quot;90%&quot;&gt;&lt;br&gt;-------------------------------------------------------------------------&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!&lt;br&gt;Studies have shown that voting for your favorite open source project,&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness&lt;br&gt;and boredom. Vote Now at &lt;a rel=&quot;nofollow&quot; class=&quot;moz-txt-link-freetext&quot; target=&quot;_blank&quot; href=&quot;http://www.sourceforge.net/community/cca08&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;/pre&gt;
  &lt;pre&gt;&lt;hr size=&quot;4&quot; width=&quot;90%&quot;&gt;&lt;br&gt;_______________________________________________&lt;br&gt;Swig-user mailing list&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18415107&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;&lt;br&gt;&lt;a rel=&quot;nofollow&quot; class=&quot;moz-txt-link-freetext&quot; target=&quot;_blank&quot; href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;  &lt;/pre&gt;
&lt;/blockquote&gt;
&lt;br&gt;
 
&lt;/div&gt;&lt;pre&gt;-------------------------------------------------------------------------&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!&lt;br&gt;Studies have shown that voting for your favorite open source project,&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness&lt;br&gt;and boredom. Vote Now at http://www.sourceforge.net/community/cca08&lt;/pre&gt;&lt;pre&gt;_______________________________________________&lt;br&gt;Swig-user mailing list&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18415107&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;&lt;br&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/pre&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;



&lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18415107&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Debugging-SWIG-modules-tp18399705p18415107.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18412188</id>
	<title>Re: suppressing half of a getter and setter</title>
	<published>2008-07-11T13:43:41Z</published>
	<updated>2008-07-11T13:43:41Z</updated>
	<author>
		<name>David Piepgrass</name>
	</author>
	<content type="html">If this is not something you do often, I recommend using %extend to
&lt;br&gt;create the setter manually and %ignore to hide the original variable.
&lt;br&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; Given something like
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; class A
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; bool x;
&lt;br&gt;&amp;gt; };
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Swig will generate A_get_X(), and A_set_X(), is there a way to
&lt;br&gt;suppress
&lt;br&gt;&amp;gt; the get, and just end up with a setter?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks
&lt;br&gt;&amp;gt; Patrick
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18412188&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/suppressing-half-of-a-getter-and-setter-tp18411773p18412188.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18411773</id>
	<title>suppressing half of a getter and setter</title>
	<published>2008-07-11T13:15:33Z</published>
	<updated>2008-07-11T13:15:33Z</updated>
	<author>
		<name>patrickinminneapolis</name>
	</author>
	<content type="html">Hi, &lt;br&gt;Given something like &lt;br&gt;&lt;br&gt;class A&lt;br&gt;{&lt;br&gt;bool x;&lt;br&gt;}; &lt;br&gt;&lt;br&gt;Swig will generate A_get_X(), and A_set_X(), is there a way to suppress the get, and just end up with a setter? &lt;br&gt;&lt;br&gt;Thanks&lt;br&gt;Patrick&lt;br&gt;
&lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18411773&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/suppressing-half-of-a-getter-and-setter-tp18411773p18411773.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18409118</id>
	<title>swig + doxygen</title>
	<published>2008-07-11T10:41:05Z</published>
	<updated>2008-07-11T10:41:05Z</updated>
	<author>
		<name>patrickinminneapolis</name>
	</author>
	<content type="html">Is anyone else using doxygen xml output to dynamically create interface files ?&amp;nbsp; I wrote something to generate interface files, but its still kind of rough around the edges, i was wondering if anyone else is pursuing the same path? &lt;br&gt;
&lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
&lt;br&gt;Studies have shown that voting for your favorite open source project,
&lt;br&gt;along with a healthy diet, reduces your potential for chronic lameness
&lt;br&gt;and boredom. Vote Now at &lt;a href=&quot;http://www.sourceforge.net/community/cca08&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceforge.net/community/cca08&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Swig-user mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=18409118&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Swig-user@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/swig-user&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/swig-user&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/swig-user-f3366.html&quot; embed=&quot;fixTarget[3366]&quot; target=&quot;_top&quot; &gt;swig-user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/swig-%2B-doxygen-tp18409118p18409118.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-18400710</id>
	<title>Re: Debugging SWIG modules</title>
	<pub