<br>Hi Danial,<br><br>Thanks a lot for sharing the solution<br>that you found to this problem.<br><br>That's the Open Source Spirit !!<br><br><br><br> Regards,<br><br><br> Luis<br><br><br>-----------------------------------------------------------<br>
<div class="gmail_quote">On Tue, Apr 13, 2010 at 5:29 AM, Danial Saruji <span dir="ltr"><<a href="mailto:DS_01@web.de">DS_01@web.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
solved my problem. It seems that you need to give as -Cindex input file a file containing the path to the idx file. I created a master index file (.mdx) containing the path and it worked.<br>
<br>
bst rgds,<br>
Danial<br>
<br>
-----Ursprüngliche Nachricht-----<br>
Von: Danial Saruji <<a href="mailto:DS_01@web.de">DS_01@web.de</a>><br>
Gesendet: 09.04.2010 15:31:37<br>
An: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br>
Betreff: wrapping with cswig<br>
<div><div></div><div class="h5"><br>
>Hi,<br>
>I'm interested in using cswig to make a c++ wrapping of a different program, and trying to understand how it works from the examples. As far as I got these are the steps required to wrap a c++ extension with cswig:<br>
><br>
>1) Create a xml description of the c++ code<br>
>2) Create the index<br>
>3) Create the cable/swig wrapper<br>
>4) Compile the original class and the created wrapper in a shared lib<br>
>5) Load it into python (or whatever)<br>
><br>
>This is what I do:<br>
><br>
>1. D:\CableSwig\bin\bin\Debug\gccxml -fxml-start=_cable_ -fxml=.\Debug\example.xml -DCSWIG -DCABLE_CONFIGURATION example.cpp<br>
><br>
>2. D:\CableSwig\bin\bin\Debug\cableidx .\Debug\example.xml .\Debug\example.idx<br>
><br>
>3. D:\CableSwig\bin\bin\Debug\cswig -ID:\PythonModules\Debug -ID:\CableSwig\CableSwig\SWIG\Lib -ID:\CableSwig\CableSwig\SWIG\Lib\python -v -module example -Cindex .\Debug\example.idx -o .\Debug\example_wrap.cxx -c++ -python .\Debug\example.xml<br>
><br>
>When reading the idx file, cswig throws an error message: error can not open {ds::Example} {example} {example1}<br>
><br>
>Any idea what I´m doing wrong? Is there maybe a detailed description of this process available? I couldn´t find much.<br>
><br>
>My example.cpp looks like this:<br>
><br>
>#include "example.h"<br>
><br>
><br>
><br>
>int ds::Example::fact(int n) {<br>
><br>
> if (n < 0){<br>
><br>
> return 0;<br>
><br>
> }<br>
><br>
> if (n == 0) {<br>
><br>
> return 1;<br>
><br>
> }<br>
><br>
> else {<br>
><br>
> return n * fact(n-1);<br>
><br>
> }<br>
><br>
>}<br>
><br>
><br>
>#ifdef CABLE_CONFIGURATION<br>
><br>
>namespace _cable_<br>
><br>
>{<br>
><br>
> const char* const group="example1";<br>
><br>
> namespace wrappers<br>
><br>
> {<br>
><br>
> typedef ds::Example example;<br>
><br>
> }<br>
><br>
>}<br>
><br>
><br>
>void cable_instantiate()<br>
><br>
>{<br>
><br>
> using namespace _cable_::wrappers;<br>
><br>
> sizeof(example);<br>
><br>
>}<br>
><br>
><br>
>#endif<br>
><br>
><br>
><br>
>Thanks and best regards,<br>
><br>
>Danial<br>
___________________________________________________________<br>
</div></div>GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!<br>
Jetzt freischalten unter <a href="http://movieflat.web.de" target="_blank">http://movieflat.web.de</a><br>
<div><div></div><div class="h5">_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br>