I got a good Automatic Number Plate Recognition Project from github (https://github.com/kornelik/anpr ). In order to run this we need OpenCV and Tesseract Optical Character Recognition library (https://code.google.com/p/tesseract-ocr/). It works fine in my Ubuntu 12.04 , 32bit system.
The problem is that while I setting the same working code in another system (Ubuntu 12.04 , 32 bit) after configuring OpenCV and Tesseract it produces the following error while making the project.I am struggling to find out what is the issue
The error is
g++ -Wall -Werror -O2 -c main.cpp -o main.o
g++ -Wall -Werror -O2 -c recognizer.cpp -o recognizer.o
g++ -Wall -Werror -O2 -c conio.cpp -o conio.o
g++ -Wall -Werror -O2 -c ocr_char.cpp -o ocr_char.o
ocr_char.cpp: In constructor ‘anpr::OCRChar::Impl::Impl(const string&, const string&)’:
ocr_char.cpp:17:9: error: ‘set’ is not a member of ‘std’
ocr_char.cpp:17:18: error: expected primary-expression before ‘char’
ocr_char.cpp:17:18: error: expected ‘;’ before ‘char’
ocr_char.cpp:23:17: error: ‘goodChars’ was not declared in this scope
make: *** [ocr_char.o] Error 1
Is your code updated? On nov 2013 there was a commit to include the set header:
https://github.com/kornelik/anpr/commit/2a63fb362e6fc79ac73f172195a893b37287d3bf
The error message you got seems to be related to that.
Compiled ok on Ubuntu 14.04 64 bits.
Related
I'm using lua-cjson
package.path = package.path .. ";../?.lua"
local json = require('cjson')
And I'm getting:
lua: error loading module 'cjson' from file '/usr/local/lib/lua/5.3/cjson.so':
dlopen(/usr/local/lib/lua/5.3/cjson.so, 6): Symbol not found: _lua_objlen
Referenced from: /usr/local/lib/lua/5.3/cjson.so
Expected in: flat namespace
in /usr/local/lib/lua/5.3/cjson.so
stack traceback:
[C]: in ?
[C]: in function 'require'
log.lua:6: in main chunk
[C]: in ?
Any ideas? Using lua 5.3
Downgrade to 2.1.0-1 as mentioned by #James Penick
luarocks remove lua-cjson
luarocks install lua-cjson 2.1.0-1
Installing https://luarocks.org/lua-cjson-2.1.0-1.src.rock
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/usr/local/include -c lua_cjson.c -o lua_cjson.o
In file included from lua_cjson.c:47:
./fpconv.h:15:20: warning: inline function 'fpconv_init' is not defined [-Wundefined-inline]
extern inline void fpconv_init();
^
lua_cjson.c:1359:5: note: used here
fpconv_init();
^
1 warning generated.
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/usr/local/include -c strbuf.c -o strbuf.o
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/usr/local/include -c fpconv.c -o fpconv.o
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -bundle -undefined dynamic_lookup -all_load -o cjson.so -L/usr/local/lib lua_cjson.o strbuf.o fpconv.o
lua-cjson 2.1.0-1 is now installed in /usr/local (license: MIT)
The problem is related to the warning message when installing lua-cjson-2.1.0.6-1
Installing https://luarocks.org/lua-cjson-2.1.0.6-1.src.rock
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/usr/local/include -c lua_cjson.c -o lua_cjson.o
lua_cjson.c:743:19: warning: implicit declaration of function 'lua_objlen' is invalid in C99 [-Wimplicit-function-declaration]
len = lua_objlen(l, -1);
^
1 warning generated.
It looks like an issue was just opened on github for this problem: https://github.com/mpx/lua-cjson/issues/56. For what it's worth, here's the workaround that I posted on github:
I'm seeing the same issue on alpine linux with with version 2.1.0.6-1 of lua-cjson, I'm currently working around the issue by explicitly specifying version 2.1.0-1.
I am trying to build lua-5.3.1 in Red Hat Enterprise Linux 6.6 platform. Following binaries will be build :
shared library : liblua.so
executable : lua
executable : luac
I have made the following changes in the provided Makefile :
Existing :
CC= gcc -std=gnu99
LUA_A= liblua.a
$(LUA_A): $(BASE_O)
$(AR) $# $(BASE_O)
$(RANLIB) $#
Modified :
CC= gcc -fPIC
LUA_A= liblua.so
$(LUA_A): $(BASE_O)
$(CC) -mthreads -shared -o $(LUA_A) $(BASE_O)
'liblua.so' and 'lua' have been built successfully using the modified Makefile. But during 'luac' build following linking error is coming :
gcc -fPIC -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o luac.o luac.c
gcc -fPIC -o luac luac.o liblua.so -lm -Wl,-E -ldl -lreadline
luac.o: In function `PrintFunction':
luac.c:(.text+0x947): undefined reference to `luaP_opnames'
luac.c:(.text+0x963): undefined reference to `luaP_opmodes'
luac.o: In function `pmain':
luac.c:(.text+0x11db): undefined reference to `luaU_dump'
/usr/bin/ld: luac: hidden symbol `luaU_dump' isn't defined
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[1]: *** [luac] Error 1
make[1]: Leaving directory `/disk1/u10rhel66/lua-5.3.1/src'
make: *** [linux] Error 2
Any help will be appreciated.
luac must be built statically linked with liblua.a.
If you really want luac linked dynamically, try this:
remove LUAI_DDEF and LUAI_DDEC from lopcodes.c and lopcodes.h
remove LUAI_FUNC from lundump.h
rebuild
recently I updated my armadillo to version 5.200.1, but when i tried to compile my code using
g++ -std=c++11 -m64 -O3 -Wall -I. -I/opt/OpenBLAS/include -fopenmp -o code.cpp.o -c code.cpp
g++ -std=c++11 -m64 -O3 -Wall -I. -I/opt/OpenBLAS/include -fopenmp -o main.cpp.o -c main.cpp
g++ -std=c++11 -m64 -O3 -o code.cpp.o main.cpp.o -lgomp -L/opt/OpenBLAS/lib -lopenblas -larmadillo
I got error message in the final linking step
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../lib/libarmadillo.so:
undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status
make: *** [a.out] Error 1
This error appears in my machine with Ubuntu 14.04LTS + gcc 4.9.2.
The Armadillo itself is linked with OpenBLAS 0.2.14 (I followed the procedure provided by Armadillo in installation)
such error doesn't occur in my macosx laptop (the same library). It means something problems with my ubuntu machine. I tried to re-install the Armadillo 4.650.2 (this version worked before), but the same error kept appearing (now older doesn't work like before). The only thing that i did before updating those libraries were "apt-self update" and "apt-self upgrade" of my ubuntu machine
is there any suggestion to fix this problem?
I also use armadillo on Ubuntu Linux
I had the same problem first when I started to program with armadillo. For g++ I only had to add -larmadillo as command line option. such as this
g++ -O2 -o armadillo_example armadillo_example.cpp -larmadillo
When using some functions in the Armadillo Algebra package I get the following errors:
armadillo_bits/atlas_wrapper.hpp:188: undefined reference to `clapack_dgetrf'
I have linked like this:
arm-linux-gnueabihf-g++ -march=armv7-a -mthumb-interwork -mfloat-abi=hard
-mfpu=neon
-mtune=cortex-a9 --sysroot=/home/mg/yocto/build/tmp/sysroots/socfpga_cyclone5
-DHAVE_CONFIG_H -I. -I.. --sysroot=/home/mg/yocto/build/tmp/sysroots
/socfpga_cyclone5 -g -O2 -L/opt/altera-linux/linaro/gcc-linaro-arm-linux-gnueabihf-
4.7-2012.11-20121123_linux/arm-linux-gnueabihf/lib -I/opt/altera-linux/linaro
/gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux/arm-linux-gnueabihf
/include -llapack -lf2c -lblas -lm --sysroot=/home/mg/yocto/build/tmp/sysroots
/socfpga_cyclone5 -MT AlgoLibTests.o -MD -MP -MF .deps/AlgoLibTests.Tpo -c -o
AlgoLibTests.o AlgoLibTests.cpp
I followed the instructions here and everything went fine:
Cross-Compiling Armadillo Linear Algebra Library
Any Ideas?
It also took me some days to be able to install armadillo for my Android development. So I want to shared with you the experience to solve your problem.
The error undefined reference to `clapack_dgetrf' is a linking error. This function should be contained in one of these libraries -llapack -lf2c -lblas. Of course it is clapack, so it should be in the lapack library. Use the command nm to check if the lapack library (liblapack.a or liblapack.so) contains this symbol. I am sure you will find out the solution then. Hope it helps.
When I try to compile libc++ (libcxx) on my Ubuntu 12.04 with LLVM 3.0 and Clang 3.0 i get the error
+ clang++ -c -g -Os -fPIC -std=c++0x -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion -Wnewline-eof -Wpadded -Wmissing-prototypes -Wstrict-aliasing=2 -Wstrict-overflow=4 -nostdinc++ -I../include ../src/stdexcept.cpp
../src/stdexcept.cpp:18:10: fatal error: 'cxxabi.h' file not found
#include <cxxabi.h>
^
1 error generated.
Where should I put cxxabi.h? It's currently in the following places
/usr/include/c++/4.4/cxxabi.h
/usr/include/c++/4.6/cxxabi.h
/usr/include/c++/4.7/cxxabi.h
My best guess is that any of these cxxabi.h will work. The only thing std except.cpp is looking for is if it is being used with libc++abi, which will be false for all 3 of your cxxabi.h.