Showing posts with label SWIG. Show all posts
Showing posts with label SWIG. Show all posts

Monday, November 16, 2020

SWIG doesn't recognize argument in make()

Hi everyone,

It's driving me NUTS! SWIG just won't recognize an argument to my make() function and hence build fails. I have other nearly identical blocks in the same module that work without issues.

What exactly generates the *swigPYTHON_wrap.cxx files and how are the argument lists for the functions determined?

Here is how my make fails:

[ 77%] Building CXX object swig/CMakeFiles/petro_swig.dir/CMakeFiles/petro_swig.dir/petro_swigPYTHON_wrap.cxx.o
/home/petro/src/gr38/gr-petro/build/swig/CMakeFiles/petro_swig.dir/petro_swigPYTHON_wrap.cxx: In function 'PyObject* _wrap_tx_msg2tag_make(PyObject*, PyObject*)':
/home/petro/src/gr38/gr-petro/build/swig/CMakeFiles/petro_swig.dir/petro_swigPYTHON_wrap.cxx:18687:48: error: no matching function for call to 'gr::petro::tx_msg2tag::make()'
18687 | result = gr::petro::tx_msg2tag::make();
| ^
In file included from /home/petro/src/gr38/gr-petro/build/swig/CMakeFiles/petro_swig.dir/petro_swigPYTHON_wrap.cxx:2881:
/home/petro/src/gr38/gr-petro/lib/../include/petro/tx_msg2tag.h:48:19: note: candidate: 'static gr::petro::tx_msg2tag::sptr gr::petro::tx_msg2tag::make(unsigned int)'
48 | static sptr make(unsigned int time_increment_factor);
| ^~~~
/home/petro/src/gr38/gr-petro/lib/../include/petro/tx_msg2tag.h:48:19: note: candidate expects 1 argument, 0 provided
/home/petro/src/gr38/gr-petro/build/swig/CMakeFiles/petro_swig.dir/petro_swigPYTHON_wrap.cxx: In function 'PyObject* _wrap_tx_msg2tag_sptr_make(PyObject*, PyObject*)':
/home/petro/src/gr38/gr-petro/build/swig/CMakeFiles/petro_swig.dir/petro_swigPYTHON_wrap.cxx:18914:30: error: no matching function for call to 'gr::petro::tx_msg2tag::make()'
18914 | result = (*arg1)->make();
| ^
In file included from /home/petro/src/gr38/gr-petro/build/swig/CMakeFiles/petro_swig.dir/petro_swigPYTHON_wrap.cxx:2881:
/home/petro/src/gr38/gr-petro/lib/../include/petro/tx_msg2tag.h:48:19: note: candidate: 'static gr::petro::tx_msg2tag::sptr gr::petro::tx_msg2tag::make(unsigned int)'
48 | static sptr make(unsigned int time_increment_factor);
| ^~~~
/home/petro/src/gr38/gr-petro/lib/../include/petro/tx_msg2tag.h:48:19: note: candidate expects 1 argument, 0 provided
make[2]: *** [swig/CMakeFiles/petro_swig.dir/build.make:63: swig/CMakeFiles/petro_swig.dir/CMakeFiles/petro_swig.dir/petro_swigPYTHON_wrap.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:466: swig/CMakeFiles/petro_swig.dir/all] Error 2
make: *** [Makefile:141: all] Error 2


As can be very, very clearly seen, tx_msg2tag::make(unsigned int) has ONE parameter (time_increment_factor). Yet SWIG wants to call gr::petro::tx_msg2tag::make().


I have tried regenerating the file, deleting build directory and starting from scratch but this error follows me like a nightmare.


Thanks for suggestions!

Lukas