|
From: Kris T. <kri...@gm...> - 2011-10-13 13:53:24
|
Hi William Thanks for your reply. Some more info below. > On 11/10/11 14:45, Kris Thielemans wrote: > > Hi > > > > I'm new to swig and am trying to wrap a C++ library. When running swig > > (2.0.4) I get things like > > > > Warning 315: Nothing known about 'std::size_t' > > Warning 315: Nothing known about 'std::random_access_iterator_tag' > > Warning 315: Nothing known about 'std::ptrdiff_t' > > > > All the time. How do I (portably) avoid these warnings? > > > > For instance, I have added > > #include<cstdio> > > In my module statement of the interface file, but that doesn't help. > > > Read about %include. However, you shouldn't get those error messages if > you are using the STL library files shipped with SWIG (wrapping the STL > container headers themselves isn't a good idea - the SWIG STL library > files should be used instead). If you are using your own container, then > look at the SWIG STL library files for ideas on wrapping your own container. > After reading up on this and some experiments, it appears that these warnings were actually generating by a "using" statement that appears in my .h file. The shortest way I can reproduce this is as follows: -------- test2.i file ----- %module test %include <stl.i> using std::size_t; --------------------------- Which then gives (with swig 2.0.4) $ swig -python -c++ test2.i test2.i:4: Warning 315: Nothing known about 'std::size_t'. test2.i:4: Warning 315: Nothing known about 'std::size_t'. test2.i:4: Warning 315: Nothing known about 'std::size_t'. test2.i:4: Warning 315: Nothing known about 'std::size_t'. test2.i:4: Warning 315: Nothing known about 'std::size_t'. It seems however that these warnings are irrelevant as the generated code acts perfectly fine. Or am I mistaken? Maybe I could switch the warning off but as I'm new to swig, I'm afraid this would hide a lot of genuine warnings. Thanks Kris |