modpython compiling error with swig 4.4.0 #1081

Closed
opened 2026-10-05 05:02:28 +02:00 by adam · 3 comments
Owner

SiD`` on IRC reported this. I can confirm it happens in cygwin.

-- Found SWIG: /usr/bin/swig.exe (found suitable version "4.4.0", minimum required is "4.0.1")
[ 27%] Built target modpython_functions
[ 27%] Building CXX object modules/CMakeFiles/module_modpython.dir/modpython.cpp.o
In file included from /home/user/znc-swig-4.4/modules/modpython.cpp:372:
/home/user/znc-swig-4.4/modules/modpython/pyfunctions.cpp: In function ‘int {anonymous}::ZNC_SWIG_AsCharPtrAndSize(PyObject*, char**, size_t*, int*)’:
/home/user/znc-swig-4.4/modules/modpython/pyfunctions.cpp:149:57: error: ‘SWIG_Python_str_AsChar’ was not declared in this scope; did you mean ‘SWIG_Python_str_FromChar’?
  149 |                                                 *cptr = SWIG_Python_str_AsChar(obj);
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~
      |                                                         SWIG_Python_str_FromChar
make[2]: *** [modules/CMakeFiles/module_modpython.dir/build.make:76: modules/CMakeFiles/module_modpython.dir/modpython.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1557: modules/CMakeFiles/module_modpython.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
SiD`` on IRC reported this. I can confirm it happens in cygwin. ``` -- Found SWIG: /usr/bin/swig.exe (found suitable version "4.4.0", minimum required is "4.0.1") ``` ``` [ 27%] Built target modpython_functions [ 27%] Building CXX object modules/CMakeFiles/module_modpython.dir/modpython.cpp.o In file included from /home/user/znc-swig-4.4/modules/modpython.cpp:372: /home/user/znc-swig-4.4/modules/modpython/pyfunctions.cpp: In function ‘int {anonymous}::ZNC_SWIG_AsCharPtrAndSize(PyObject*, char**, size_t*, int*)’: /home/user/znc-swig-4.4/modules/modpython/pyfunctions.cpp:149:57: error: ‘SWIG_Python_str_AsChar’ was not declared in this scope; did you mean ‘SWIG_Python_str_FromChar’? 149 | *cptr = SWIG_Python_str_AsChar(obj); | ^~~~~~~~~~~~~~~~~~~~~~ | SWIG_Python_str_FromChar make[2]: *** [modules/CMakeFiles/module_modpython.dir/build.make:76: modules/CMakeFiles/module_modpython.dir/modpython.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:1557: modules/CMakeFiles/module_modpython.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 ``` <!-- github-sync-id:3561569068 -->
adam closed this issue 2026-10-05 05:02:28 +02:00
Author
Owner

I've created a pull request to fix this issue

https://github.com/znc/znc/pull/1984

I've created a pull request to fix this issue https://github.com/znc/znc/pull/1984 <!-- github-comment-id:3500877339 -->
Author
Owner

https://github.com/swig/swig/commit/491994c8362c04dbe89690e93bbf672d3b0dd1d9 is the reason why the wrong branch is chosen now.

Need better way to check the swig version, e.g. actually parse the output of -version

https://github.com/swig/swig/commit/491994c8362c04dbe89690e93bbf672d3b0dd1d9 is the reason why the wrong branch is chosen now. Need better way to check the swig version, e.g. actually parse the output of -version <!-- github-comment-id:3505481707 -->
Author
Owner

Need better way to check the swig version, e.g. actually parse the output of -version

Gave this a shot - I managed at least to build 1.10.1 with this patch against swig 4.4.0

> Need better way to check the swig version, e.g. actually parse the output of -version Gave this a shot - I managed at least to build 1.10.1 with this patch against swig 4.4.0 <!-- github-comment-id:3601251676 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#1081