On 05/24/2011 11:43 AM, John Cummings wrote:
> Hello,
>
> I received the warning message:
>
> skipping field 'scalar' with unmatched type size_t
>
> in my bindings and simplified the problem to make it happen when
> building a modified version of the libfoo example.
>
> I found this thread from the mailing list that included a partial solution:
>
> http://groups.google.com/group/pyside/browse_thread/thread/b17ebb2a0b8e9698/97e1a0d0832ffc9d
>
> The basic answer was twofold. First, use the proper include file. I
> added the <cstddef> header in my case. This addition didn't seem to make
> a difference for me. The second part was to explicitly tell the
> generator what a size_t should be:
>
> <primitive-type name="size_t" default-constructor="0"
> target-lang-api-name="PyLong" />
>
> This method generally works, however, I have two issues with this approach:
>
> 1. Is a PyLong really the same as size_t on all platforms (32/64 bit,
> Linux, Windows, Mac, etc.)?
> 2. This approach doesn't seem to work for array types.
>
> On the not working with an array, I modified the libfoo example and
> added two public member variables:
>
> size_t scalar;
> size_t array[2];
>
> That is, one regular variable and one array. The regular variable
> compiles just fine. The array variable does not compile and fails as
> follows using 1.0.2 release on 64-bit Linux:
>
> math_wrapper.cpp: In function ‘int Sbk_Math_set_array(PyObject*,
> PyObject*, void*)’:
> math_wrapper.cpp:360:10: error: ‘isConvertible’ is not a member of
> ‘Shiboken::Converter<long unsigned int []>’
> math_wrapper.cpp:365:56: error: ‘toCpp’ is not a member of
> ‘Shiboken::Converter<long unsigned int []>’
>
> The array syntax has obviously confused the generator. I just tried
> changing the C++ code to use an "int" instead of size_t and I get
> basically the same error. Perhaps I have unwittingly uncovered a larger
> bug, although I suspect I have simply missed some documentation.
>
> I can certainly file a bug report if necessary.
>
> Thank you
> John Cummings
> _______________________________________________
> PySide mailing list
> [email protected]
> http://lists.pyside.org/listinfo/pyside
>   

The Google link I sent apparently requires a login, try gmane instead to
enjoy login-free browsing:

http://article.gmane.org/gmane.comp.lib.qt.pyside/1589/

My apologies for sending a semi-hidden link.


_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to