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.
Related
I have written a simple pushbutton example code (Ubuntu 14.01) and it is giving me strange error after make.
Following is the o/p of make:
gcc -c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/i386-linux-gnu/qt5/mkspecs/linux-g++ -I. -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -o .o /
gcc: warning: /: linker input file unused because linking not done
g++ -Wl,-O1 -o PushButtonExample\ TEMPLATE\ =\ app main.o .o mainwindow.o moc_mainwindow.o -lQt5Widgets -L/usr/lib/i386-linux-gnu -lQt5Gui -lQt5Core -lGL -lpthread
g++: error: .o: No such file or directory
make: *** [PushButtonExample TEMPLATE = app] Error 1
From above o/p, I am not really getting the meaning of g++: error: .o: No such file or directory, because it is not showing any file name. I searched for similar issue on Internet, but everywhere there is a file.o scenario.
Kindly help me through.
Try change your .pro file as below:
TEMPLATE = app
TARGET = QtHelloWorld
QT += core gui
QT += widgets
SOURCES += main.cpp
SOURCES += mainwindow.cpp
HEADERS += mainwindow.h
Running setup.py bdist_wheel for gnureadline
Error:
DHAVE_RL_CALLBACK -DHAVE_RL_CATCH_SIGNAL -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK -DHAVE_RL_COMPLETION_MATCHES -DHAVE_RL_COMPLETION_SUPPRESS_APPEND -DHAVE_RL_PRE_INPUT_HOOK -I. -I/usr/include/python2.7 -c Modules/2.x/readline.c -o build/temp.linux-x86_64-2.7/Modules/2.x/readline.o
In file included from Modules/2.x/readline.c:31:0:
./readline/readline.h:385:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/Modules/2.x/readline.o readline/libreadline.a readline/libhistory.a -lncurses -o build/lib.linux-x86_64-2.7/gnureadline.so
/usr/bin/ld: cannot find -lncurses
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Mange Jenkins settings:
Python : CPython-2.7
Path: /usr/bin/python
The problem was gnureadline was in my requirements.txt and when building the virtual environments and installing requirements it could not install the package.
gnureadline isn't required on most OSes. As Ludwig points out in this post:
gnureadline [is only needed] on platforms that don't provide readline
at all, or that substitute readline for an incompatible product like
libedit (i.e. Mac OS X)
So the solution was simply to remove gnureadline from requirements.txt
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
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.