Could your guys see what is wrong with my following c++ extension code?

Heollo, guys, I try to wrap a c++ extension class requiring qt lib through boost.python, I failed always because of the following error: c:\Python23\include\object.h(343): error C2059: syntax error : ';' My code will link to qt-2.30nc lib (window version). I don't know why. Can someone give ahint how to fix it? Thank you very much. Fang ----------------------------------------------- #ifndef IMAGEPROCESS_H #define IMAGEPROCESS_H #ifdef IMAGEPROCESS_EXPORTS #define IMAGEPROCESS_API __declspec(dllexport) #else #define IMAGEPROCESS_API __declspec(dllimport) #endif #include <qimage.h> //#include <boost/python/class_builder.hpp> // for the python hooks into the dll #include <boost/python.hpp> #include <boost/python/module.hpp> #include <boost/python/def.hpp> using namespace boost::python; //#include <qimage.h> // This class is exported from the ImageProcess.dll class IMAGEPROCESS_API ImageProcess { public: ImageProcess(); ~ImageProcess(){}; void setContrast(float contrt); void setBrite(int brite); void adjustContrastBrite(QImage &img); private: float contrast; int brightness; }; ImageProcess::ImageProcess():contrast(1.0),brightness(0){}; //using namespace boost::python; BOOST_PYTHON_MODULE(ImageProcess) { class_<ImageProcess>("ImageProcess",init<>()) .def("setBrite",&ImageProcess::setBrite) .def("setContrast",&ImageProcess::setContrast) .def("adjustContrastBrite",&ImageProcess::adjustContrastBrite) ; } #endif __________________________________ Do you Yahoo!? Yahoo! Search - Find what you�re looking for faster http://search.yahoo.com

Shunming Fang <shunm_fang@yahoo.com> writes:
Heollo, guys, I try to wrap a c++ extension class requiring qt lib through boost.python, I failed always because of the following error: c:\Python23\include\object.h(343): error C2059: syntax error : ';'
My code will link to qt-2.30nc lib (window version). I don't know why. Can someone give ahint how to fix it?
Your first #include file must always be a Boost.Python header. HTH, -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (2)
-
David Abrahams
-
Shunming Fang