[C++-sig] Problem with Pyste and simple struct

Thomas Hauk thauk at novuscom.net
Sat Sep 29 06:48:44 CEST 2007


Given Foo.h:

	struct Foo
	{
		unsigned char data[4];
	};

Pyste produces the following binding:

	// Module  
======================================================================
	BOOST_PYTHON_MODULE(PysteTest)
	{
	    class_< Foo >("Foo", init<  >())
	        .def(init< const Foo& >())
         	.def_readwrite("data", &Foo::data)
	    ;
	}

When compiled using bjam, produces the following error:

	..\..\boost\1_34_1\boost\python\data_members.hpp(64) : error C2440:  
'=' : cannot
	convert from 'const unsigned char [4]' to 'unsigned char [4]'
         	There is no context in which this conversion is possible

I've poured through the documentation, tutorials, everything, and I  
haven't found a single example like this.

What is wrong, and how do I fix it?

T

--
Some people, when confronted with a problem, think "I know, I'll use  
regular expressions."  Now they have two problems.
   --Jamie Zawinski, in comp.lang.emacs




More information about the Cplusplus-sig mailing list