Boost logo

Boost Users :

From: Shunming Fang (shunm_fang_at_[hidden])
Date: 2004-03-12 13:04:44


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net