Openalpr: can not run the make command in max os

Created on 21 Dec 2018  路  10Comments  路  Source: openalpr/openalpr

did i miss anything ?

make
[ 24%] Built target support
[ 24%] Built target video
[ 24%] Building CXX object openalpr/CMakeFiles/openalpr.dir/ocr/tesseract_ocr.cpp.o
In file included from /Users/yingqgu/openalpr/src/openalpr/ocr/tesseract_ocr.cpp:20:
In file included from /Users/yingqgu/openalpr/src/openalpr/ocr/tesseract_ocr.h:35:
In file included from /usr/local/include/tesseract/baseapi.h:27:
In file included from /usr/local/include/tesseract/apitypes.h:23:
/usr/local/include/tesseract/publictypes.h:33:1: error: unknown type name 'constexpr'
constexpr int kPointsPerInch = 72;
^
/usr/local/include/tesseract/publictypes.h:33:11: error: expected unqualified-id
constexpr int kPointsPerInch = 72;
^
/usr/local/include/tesseract/publictypes.h:38:1: error: unknown type name 'constexpr'
constexpr int kMinCredibleResolution = 70;
^
/usr/local/include/tesseract/publictypes.h:38:11: error: expected unqualified-id
constexpr int kMinCredibleResolution = 70;
^
/usr/local/include/tesseract/publictypes.h:40:1: error: unknown type name 'constexpr'
constexpr int kMaxCredibleResolution = 2400;
^
/usr/local/include/tesseract/publictypes.h:40:11: error: expected unqualified-id
constexpr int kMaxCredibleResolution = 2400;
^
/usr/local/include/tesseract/publictypes.h:45:1: error: unknown type name 'constexpr'
constexpr int kResolutionEstimationFactor = 10;
^
/usr/local/include/tesseract/publictypes.h:45:11: error: expected unqualified-id
constexpr int kResolutionEstimationFactor = 10;
^
In file included from /Users/yingqgu/openalpr/src/openalpr/ocr/tesseract_ocr.cpp:20:
In file included from /Users/yingqgu/openalpr/src/openalpr/ocr/tesseract_ocr.h:35:
In file included from /usr/local/include/tesseract/baseapi.h:31:
/usr/local/include/tesseract/resultiterator.h:103:63: error: a space is required between consecutive right angle brackets (use '> >')
virtual std::vector>>* GetBestLSTMSymbolChoices() const;
^
In file included from /Users/yingqgu/openalpr/src/openalpr/ocr/tesseract_ocr.cpp:20:
In file included from /Users/yingqgu/openalpr/src/openalpr/ocr/tesseract_ocr.h:35:
In file included from /usr/local/include/tesseract/baseapi.h:32:
/usr/local/include/tesseract/serialis.h:43:1: error: unknown type name 'constexpr'
constexpr size_t countof(T const (&)[N]) noexcept {
^
/usr/local/include/tesseract/serialis.h:43:17: error: expected ';' at end of declaration
constexpr size_t countof(T const (&)[N]) noexcept {
^
/usr/local/include/tesseract/serialis.h:43:18: error: C++ requires a type specifier for all declarations
constexpr size_t countof(T const (&)[N]) noexcept {
^
/usr/local/include/tesseract/serialis.h:43:26: error: use of undeclared identifier 'T'
constexpr size_t countof(T const (&)[N]) noexcept {
^
/usr/local/include/tesseract/serialis.h:43:41: error: expected ';' after top level declarator
constexpr size_t countof(T const (&)[N]) noexcept {
^
/usr/local/include/tesseract/serialis.h:56:40: error: unknown type name 'size_t'
bool DeSerialize(FILE* fp, char* data, size_t n = 1);
^
/usr/local/include/tesseract/serialis.h:57:41: error: unknown type name 'size_t'
bool DeSerialize(FILE* fp, float* data, size_t n = 1);
^
/usr/local/include/tesseract/serialis.h:58:42: error: unknown type name 'size_t'
bool DeSerialize(FILE* fp, int8_t* data, size_t n = 1);
^
/usr/local/include/tesseract/serialis.h:59:43: error: unknown type name 'size_t'
bool DeSerialize(FILE* fp, int16_t* data, size_t n = 1);
^
/usr/local/include/tesseract/serialis.h:60:43: error: unknown type name 'size_t'
bool DeSerialize(FILE* fp, int32_t* data, size_t n = 1);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: * [openalpr/CMakeFiles/openalpr.dir/ocr/tesseract_ocr.cpp.o] Error 1
make[1]:
[openalpr/CMakeFiles/openalpr.dir/all] Error 2
make: *
* [all] Error 2

Most helpful comment

ok, I've succeeded in compiling openalpr myself instead. On the mac the instructions nowadays need slight tweaking as follows:

brew install tesseract opencv@3 log4cplus
git clone https://github.com/openalpr/openalpr.git
cd openalpr/src
mkdir build
cd build
export OpenCV_DIR="/usr/local/opt/opencv@3/"
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_MACOSX_RPATH=true -DCMAKE_CXX_FLAGS="-std=c++11"
make
sudo make install

done!

All 10 comments

I've got the same thing going on. Hopefully someone who understands this stuff will chime in.

Hi guys.
I have the same problem. Any news regarding this one?
I'm running on 10.14.2 Mojave.

+1
running High Sierra 10.13.6

10.14.3

Yes, I've got the same issue while following the brew installation instructions, so while running the brew install openalpr command.

ok, I've succeeded in compiling openalpr myself instead. On the mac the instructions nowadays need slight tweaking as follows:

brew install tesseract opencv@3 log4cplus
git clone https://github.com/openalpr/openalpr.git
cd openalpr/src
mkdir build
cd build
export OpenCV_DIR="/usr/local/opt/opencv@3/"
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_MACOSX_RPATH=true -DCMAKE_CXX_FLAGS="-std=c++11"
make
sudo make install

done!

Wow, that worked for me. Thanks so much @Hildebrand!

@Hildebrand's solution worked for me as well.

+1
when i set CMAKE_CXX_FLAGS="-std=c++11"
I got the result

export OpenCV_DIR="/usr/local/opt/opencv@3/"

Is this the path where your openalpr resides?

Was this page helpful?
0 / 5 - 0 ratings