From: Alexandre G. <gi...@sc...> - 2006-08-29 17:37:37
|
Hi, I am trying to wrappe a c++ library, but I get an syntax error while running swig on my header file. Swig give me : Error: Syntax error in input(3). at line in bold ( line starting with static const int PIX_SIZE in following code ( last line) ) Any idea how I can get rid of the problem. Thanks Alex The header file contains: class TrackerImpl : public Tracker { public: enum { PATTERN_WIDTH = __PATTERN_SIZE_X, PATTERN_HEIGHT = __PATTERN_SIZE_Y, PATTERN_SAMPLE_NUM = __PATTERN_SAMPLE_NUM, MAX_LOAD_PATTERNS = __MAX_LOAD_PATTERNS, MAX_IMAGE_PATTERNS = __MAX_IMAGE_PATTERNS, WORK_SIZE = 1024*MAX_IMAGE_PATTERNS, #ifdef _OLD_MSCOMPILER_ PIX_FORMAT = __PIX_FORMAT, // calculate pixel size from pixel format PIX_SIZE = PIX_FORMAT==PIXEL_FORMAT_LUM ? 1 : (PIX_FORMAT==PIXEL_FORMAT_RGB565 ? 2 : ((PIX_FORMAT==PIXEL_FORMAT_RGB || PIX_FORMAT==PIXEL_FORMAT_BGR) ? 3 : 4) ), #endif //_OLD_MSCOMPILER_ #ifdef SMALL_LUM8_TABLE LUM_TABLE_SIZE = (0xffff >> 6) + 1, #else LUM_TABLE_SIZE = 0xffff + 1, #endif }; #ifndef _OLD_MSCOMPILER_ // These are used in comparisons with other enums, therefore they // can't be anonymous enums static const int PIX_FORMAT = __PIX_FORMAT; *static const int PIX_SIZE = PIX_FORMAT==PIXEL_FORMAT_LUM ? 1 :(PIX_FORMAT==PIXEL_FORMAT_RGB565 ? 2 :((PIX_FORMAT==PIXEL_FORMAT_RGB || PIX_FORMAT==PIXEL_FORMAT_BGR) ? 3 : 4) );* #endif //_OLD_MSCOMPILER_ -- o Alexandre Gillet email: gi...@sc... / The Scripps Research Institute, o Dept. Molecular Biology, MB-5, \ 10550 North Torrey Pines Road, o La Jolla, CA 92037-1000, USA. / tel: (858) 784-2053 o fax: (858) 784-2860 |