[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #49712] Cannot unload oct file from a SWIG gen
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #49712] Cannot unload oct file from a SWIG generated wrapper |
Date: |
Sun, 27 Nov 2016 12:14:10 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0 |
Follow-up Comment #2, bug #49712 (project octave):
Hi Mike,
Thanks a lot for the fast feedback. Interesting results; most likely is seems
bound to my setup.
I attached a simple test case:
- swig_test.hpp / swig_test.cpp are the files to be wrapped
- swig_test.i is the swig interface file
- wrapper.cpp is the wrapper generated by swig (3.0.10) through the command:
swig -c++ -octave -o wrapper.cpp swig_test.i
- To generate the oct file I ran:
mkoctfile -std=c++11 --no-gnu-unique -o swig_test.oct swig_test.cpp
wrapper.cpp
Then, in Octave, it followed these steps:
> swig_test
2 swig_ref objects ('cvar' and 'swig_test') appeared in the workspace.
> test
> test
> test
Printed 0, then 1, then 2.
> clear all
Then the workspace was cleared.
> test
And here I got a 3 in the output while I expected the command not to be found.
It shows that the library was still loaded.
This is fully repeatable on my setup.
The only way I could get it working is if I create a symlink 'test.oct'
pointing to 'swig_test.oct'. Then calling 'test' from Octave and performing a
'clear all' works as expected. But I don't see how I can extend this if C++
classes are involved.
Am I missing something obvious? If you need more details, please feel free to
ask.
(file #39080, file #39081, file #39082, file #39083)
_______________________________________________________
Additional Item Attachment:
File name: swig_test.cpp Size:0 KB
File name: swig_test.i Size:0 KB
File name: swig_test.hpp Size:0 KB
File name: wrapper.cpp Size:88 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?49712>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/