#ifdef _MSC_VER // disable warning C4786: symbol greater than 255 character, // nessesary to ignore as <map> causes lots of warning #pragma warning(disable: 4786) #endif
class test_module : public Py::ExtensionModule<test_module>{ public: test_module():Py::ExtensionModule<test_module>( "test" ){ add_varargs_method("func", &test_module::func2, "test function2"); initialize( "this is the test module" ); }
// symbol required for the debug version extern "C" void inittest_d() { inittest(); }
mac_py26.mak
# # Build the example on Mac OS X for version 2.6 # CC=gcc -arch i386 CCC=g++ -arch i386 CCCFLAGS=-c -g -fPIC -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I. LDSHARED=$(CCC) -bundle -g -u _PyMac_Error -F/Library/Frameworks -framework System \ /Library/Frameworks/Python.framework/Versions/2.6/Python LDLIBS= PYTHON=/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
~/pycxx-6.1.1$ python Python 2.6.3 (r263:75184, Oct 2 2009, 07:56:03) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> import test >>> l = test.func(range(3),10) 10.0 >>> l [0, 1, 2, 10.0] >>> type(l) <type 'list'> >>>