Menu

#697 templates using import fails

None
closed-duplicate
python (260)
5
2025-06-10
2006-06-20
No

I am having problems with the cvs version of swig when
I am targeting
python. I am using %import and %extend as shown in the
attached
tarball. The problem occurs when I instantiate a
template from an
"imported" interface that has an "extended" method.
The extended
method has not been declared and thus causes an error.

Discussion

  • Joseph Winston

    Joseph Winston - 2006-06-20
     
  • Olly Betts

    Olly Betts - 2022-03-03

    With current git master compilation still fails:

    g++ -c -fpic -I. -I/usr/include  spam_wrap.cxx     -I/usr/include/python3.9 -I/usr/include/python3.9
    spam_wrap.cxx: In function PyObject* _wrap_BarPtr___len__(PyObject*, PyObject*):
    spam_wrap.cxx:3360:17: error: Bar___len____SWIG was not declared in this scope
     3360 |   result = (int)Bar___len____SWIG((Bar*)(arg1)->operator ->());
          |                 ^~~~~~~~~~~~~~~~~
    

    I should note I haven't tried to understand the example so maybe it's something which isn't expected to work. My current focus is trying to clean up the old sourceforge bug tracker by closing bugs which have since been fixed or are also reported in the active github tracker.

     
  • Olly Betts

    Olly Betts - 2023-02-11

    I think this is probably essentially the same as https://github.com/swig/swig/issues/2089

     
  • Olly Betts

    Olly Betts - 2025-06-10
    • status: open --> closed-duplicate
    • Group: -->
     
  • Olly Betts

    Olly Betts - 2025-06-10

    I'm going to close as a duplicate of the newer ticket in the live tracker, and note there that the testcase here should be checked against any candidate fix.

     

Log in to post a comment.

Monday.com Logo