MichalBusta / FASText

Efficient Unconstrained Scene Text Detector
GNU General Public License v2.0
191 stars 74 forks source link

build problem #3

Closed DuyHuynhLe closed 8 years ago

DuyHuynhLe commented 8 years ago

Hello, I'm trying to build the project and these errors appear. Could you help me find a resolve this problem? My system is Debian Jessie with OpenCV 2.4.9,

~FASText-master/src/Python/pyFastTextG.cpp:

In function ‘PyObject* toPython(const T&)’: ~FASText-master/src/Python/pyFastTextG.cpp:146:44: error: there are no arguments to ‘PyInt_FromLong’ that depend on a template parameter, so a declaration of ‘PyInt_FromLong’ must be available [-fpermissive] PyObject _p = PyIntFromLong((long) input); ^ ~FASText-master/src/Python/pyFastTextG.cpp:146:44: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) ~FASText-master/src/Python/pyFastTextG.cpp: In function ‘void exportLetter(PyArrayObject, int&, cmp::LetterCandidate&)’: ~FASText-master/src/Python/pyFastTextG.cpp:180:53: error: ‘PyInt_FromLong’ was not declared in this scope PyArray_SETITEM(out, ptr, PyInt_FromLong(det.bbox.x)); ^ ~FASText-master/src/Python/pyFastTextG.cpp: In function ‘PyArrayObject* get_keypoint_strokes(int, int)’: ~FASText-master/src/Python/pyFastTextG.cpp:326:61: error: ‘PyInt_FromLong’ was not declared in this scope PyArray_SETITEM(out, ptr, PyInt_FromLong(it->second.first)); ^ ~FASText-master/src/Python/pyFastTextG.cpp:352:68: error: ‘PyInt_FromLong’ was not declared in this scope PyArray_SETITEM(out, ptr, PyInt_FromLong(strokes[i][j]->center.x)); ^ ~FASText-master/src/Python/pyFastTextG.cpp: In instantiation of ‘PyObject* toPython(const T&) [with T = int; PyObject = _object]’: ~FASText-master/src/Python/pyFastTextG.cpp:165:34: required from ‘PyArrayObject* toPython(std::vector<_RealType>&, std::true_type) [with T = int; PyArrayObject = tagPyArrayObject; std::true_type = std::integral_constant<bool, true>]’ ~FASText-master/src/Python/pyFastTextG.cpp:174:51: required from ‘PyArrayObject* toPython(std::vector<_RealType>&) [with T = int; PyArrayObject = tagPyArrayObject]’ ~FASText-master/src/Python/pyFastTextG.cpp:200:59: required from here ~FASText-master/src/Python/pyFastTextG.cpp:146:44: error: ‘PyInt_FromLong’ was not declared in this scope PyObject _p = PyInt_FromLong((long) input); ^ In file included from /usr/include/python2.7/numpy/ndarrayobject.h:26:0, from /usr/include/python2.7/numpy/arrayobject.h:4, from ~FASText-master/src/Python/pyFastTextG.h:22, from ~FASText-master/src/Python/pyFastTextG.cpp:22: /usr/include/python2.7/numpy/__multiarray_api.h: At global scope: /usr/include/python2.7/numpy/__multiarray_api.h:1629:1: warning: ‘int _import_array()’ defined but not used [-Wunused-function] _import_array(void) ^ src/Python/CMakeFiles/fasttext_py.dir/build.make:54: recipe for target 'src/Python/CMakeFiles/fasttextpy.dir/pyFastTextG.cpp.o' failed make[2]: ** [src/Python/CMakeFiles/fasttext_py.dir/pyFastTextG.cpp.o] Error 1 CMakeFiles/Makefile2:166: recipe for target 'src/Python/CMakeFiles/fasttext_py.dir/all' failed make[1]: * [src/Python/CMakeFiles/fasttext_py.dir/all] Error 2 Makefile:76: recipe for target 'all' failed make: * [all] Error 2

MichalBusta commented 8 years ago

Hello, what compiler are you using? (g++ which version? )

DuyHuynhLe commented 8 years ago

I'm using gcc version 4.9.2 (Debian 4.9.2-10)

MichalBusta commented 8 years ago

sorry, can not reproduce the error.,

what you can do: run make VERBOSE=1 (this will print full g++ command with parameters) and observe, if all include directories are correct.

if yes, check if the required function PyInt_FromLong is visible. the PyAPI_FUNC(PyObject *) PyInt_FromLong(long) shoud be declared in file intobject.h which shoud be included from Python.h