Compiling libdecodeqr 0.9.4 on Ubuntu 12.04 - compilation

I was using this library on Ubuntu 10.10 with OpenCV 2.2 and it worked really good. Much better than the 0.9.3 version! Now I am updating my system and I still want to use libdecodeqr 0.9.4, but I get a compile error:
galois.cpp: In member function ‘Galois::Polynomial* Galois::Polynomial::_lu(Galois::Polynomial)’:
galois.cpp:400:48: error: taking address of temporary [-fpermissive]
galois.cpp:403:65: error: taking address of temporary [-fpermissive]
galois.cpp: In member function ‘Galois::Polynomial Galois::Polynomial::solve(Galois::Polynomial)’:
galois.cpp:458:69: error: taking address of temporary [-fpermissive]
galois.cpp:464:56: error: taking address of temporary [-fpermissive]
galois.cpp:466:54: error: taking address of temporary [-fpermissive]
galois.cpp: In member function ‘int Galois::BCH::decode(int)’:
galois.cpp:565:56: error: taking address of temporary [-fpermissive]
galois.cpp:567:59: error: taking address of temporary [-fpermissive]
galois.cpp: In member function ‘Galois::Nomial Galois::BCH::_error_syndrome(int)’:
galois.cpp:592:44: error: taking address of temporary [-fpermissive]
make[1]: *** [galois.lo] Error 1
make[1]: Leaving directory `/home/xxx/Downloads/libdecodeqr-0.9.4/libdecodeqr'
make: *** [all-recursive] Error 1
I am on Ubuntu 12.04 and OpenCV 2.4. I did the src install like ./configure make make install. What can I do to make this compile?
Thank you

I figured it out. The problem is that the new gcc compiler "turns taking address of temporary" in an error instead of a warning.
Build libdecodeqr the following way to let it compile:
sudo make CXXFLAGS+=-fpermissive
After that, obviously:
sudo make install
sudo ldconfig

Related

Error installing ruby 1.8 in ubuntu 18.04

I removed installed ruby: sudo apt-get purge ruby
and I Download and compile ruby:
wget http://cache.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.tar.gz
tar -xzvf ruby-1.8.7-p374.tar.gz
cd ruby-1.8.7-p374
./configure
AND Build a MakeFile using the specific compiler.
make CC=gcc-4.4
An error occurred when compiling.
Error in compiling openssl
compiling openssl
make[1]: 디렉터리 '/ruby-1.8.7-p374/ext/openssl' 들어감
gcc-4.4 -I. -I../.. -I../../. -I../.././ext/openssl -
DRUBY_EXTCONF_H=\"extconf.h\" -fPIC -g -O2 -c ossl_hmac.c
In file included from ossl.h:57,
from ossl_hmac.c:13:
/usr/include/openssl/asn1_mac.h:10: error: #error "This file is obsolete;
please update your software."
In file included from ossl.h:205,
from ossl_hmac.c:13:
openssl_missing.h:79: error: macro "EVP_MD_CTX_create" passed 1 arguments, but takes just 0
openssl_missing.h:83: error: expected declaration specifiers or ‘...’ before ‘(’ token
openssl_missing.h:83: error: conflicting types for ‘EVP_MD_CTX_reset’
/usr/include/openssl/evp.h:498: note: previous declaration of
‘EVP_MD_CTX_reset’ was here
openssl_missing.h:91: error: expected declaration specifiers or ‘...’ before ‘(’ token
ossl_hmac.c: In function ‘ossl_hmac_alloc’:
ossl_hmac.c:54: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX’
ossl_hmac.c:54: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX’ `enter code here`
ossl_hmac.c: In function ‘ossl_hmac_initialize’:
ossl_hmac.c:73: warning: ‘HMAC_Init’ is deprecated (declared at /usr/include/openssl/hmac.h:28)
ossl_hmac.c: In function ‘hmac_final’:
ossl_hmac.c:114: error: storage size of ‘final’ isn’t known
ossl_hmac.c: In function ‘ossl_hmac_reset’:
ossl_hmac.c:182: warning: ‘HMAC_Init’ is deprecated (declared at /usr/include/openssl/hmac.h:28)
Makefile:197: recipe for target 'ossl_hmac.o' failed
make[1]: *** [ossl_hmac.o] Error 1
make[1]: DIR '/ruby-1.8.7-p374/ext/openssl' 나감
Makefile:293: recipe for target 'all' failed
make: *** [all] Error 1`
How can i resolve this error..
I ran into a very similar error installing 1.9.3 on Ubuntu 18.04. I did the following to get around it -
sudo apt install libssl1.0-dev
and then rebuilt Ruby.

Raspberry Pi V4L2 Compile Error How to Fix

I am using opencv with python on raspberry pi so according to tutorials on the internet I need the V4L2 driver. I'm following this tutorial to install the driver https://www.ics.com/blog/raspberry-pi-camera-module#.VAaCHqM0_YQ
However when I compile I get this error. I don't know what's the problem and have never ran into this problem before. How do I fix this. Thanks.
make[3]: Entering directory '/home/pi/v4l-utils/utils/v4l2-compliance'
CXX v4l2-test-input-output.o
v4l2-test-input-output.cpp: In function ‘int checkInput(node*, const v4l2_input&, unsigned int)’:
v4l2-test-input-output.cpp:368:3: error: expected primary-expression before ‘.’ token
v4l2-test-input-output.cpp:369:3: error: expected primary-expression before ‘.’ token
v4l2-test-input-output.cpp: In function ‘int checkOutput(node*, const v4l2_output&, unsigned int)’:
v4l2-test-input-output.cpp:733:3: error: expected primary-expression before ‘.’ token
v4l2-test-input-output.cpp:734:3: error: expected primary-expression before ‘.’ token
Makefile:438: recipe for target 'v4l2-test-input-output.o' failed
make[3]: *** [v4l2-test-input-output.o] Error 1
make[3]: Leaving directory '/home/pi/v4l-utils/utils/v4l2-compliance'
Makefile:373: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/pi/v4l-utils/utils'
Makefile:470: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pi/v4l-utils'
Makefile:398: recipe for target 'all' failed
make: *** [all] Error 2
The line numbers have changed somewhat in the 2+ years since this question was posted. It could have easily had more bugs back then with Raspbian 7 Wheezy on a Raspberry Pi 2 or classic Pi.
One correction to the webpage would be that it's better to run ./bootstrap.sh rather than autoreconf. I also write libjpeg-dev to avoid dependency problems with the too-specific libjpeg62-dev. Then the build and installation works fine today on Raspbian 9 Stretch (gcc 6.3):
sudo apt-get install autoconf gettext libtool libjpeg-dev
git clone git://git.linuxtv.org/v4l-utils.git
cd v4l-utils
./bootstrap.sh
./configure
make
sudo make install

compile Ruby 2.0 errors without rvm or rbenv , `readline.c:1886:26: error: 'Function' undeclared (first use in this function)`

I want to install gitlab, which don't recommend to use any ruby version manager.
But
This is my OS Linux dqa-dev 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:08:14 UTC 2014 i686 i686 i686 GNU/Linux
linking shared-object psych.so
installing default psych libraries
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/psych'
make[2]: Entering directory `/home/poc/ruby-2.0.0-p451/ext/pty'
compiling pty.c
pty.c: In function 'chfunc':
pty.c:143:12: warning: ignoring return value of 'seteuid', declared with attribute warn_unused_result [-Wunused-result]
seteuid(getuid());
^
linking shared-object pty.so
installing default pty libraries
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/pty'
make[2]: Entering directory `/home/poc/ruby-2.0.0-p451/ext/racc/cparse'
compiling cparse.c
linking shared-object racc/cparse.so
installing default cparse libraries
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/racc/cparse'
make[2]: Entering directory `/home/poc/ruby-2.0.0-p451/ext/readline'
compiling readline.c
readline.c: In function 'Init_readline':
readline.c:1886:26: error: 'Function' undeclared (first use in this function)
rl_pre_input_hook = (Function *)readline_pre_input_hook;
^
readline.c:1886:26: note: each undeclared identifier is reported only once for each function it appears in
readline.c:1886:36: error: expected expression before ')' token
rl_pre_input_hook = (Function *)readline_pre_input_hook;
^
readline.c: At top level:
readline.c:530:1: warning: 'readline_pre_input_hook' defined but not used [-Wunused-function]
readline_pre_input_hook(void)
^
make[2]: *** [readline.o] Error 1
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/readline'
make[1]: *** [ext/readline/all] Error 2
make[1]: Leaving directory `/home/poc/ruby-2.0.0-p451'
make: *** [build-ext] Error 2
I also have Ubuntu 14.04 and I got to make it work. Sharing what I did just in case it works for you.
I patched the file ext/readline/readline.c replacing line 1886:
rl_pre_input_hook = (Function *)readline_pre_input_hook;
With
rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
Then I tried to make it again and it worked.
Source: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741825
I also ran into this issue trying to install ruby-2.0.0-p247 with rbenv. Save some time by using this patch.
You can run it like this:
curl -fsSL https://gist.github.com/ference/d3d4cbbe18309a91ad9b/raw/267ea89fa145c536967831e1af4dea030297b53e/ruby-2.0.0-p247.patch | rbenv install --patch 2.0.0-p247
This is my solution on Ubuntu 14.04 Server edition.
I need to install underline
sudo apt-get install libreadline6 libreadline6-dev
Then, the problem was fixed.
Found a solution from https://github.com/sstephenson/ruby-build/issues/690. What actually missing is libffi-dev. I tried on Ubuntu 12.04 and it is successful.
sudo apt-get install libffi-dev

Silabs USB TO UART Debian build error

I'm having a problem installing a driver for my Silabs USB to UART bridge.
I download my driver from here:
http://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx
I'm running Ubuntu 12.04 32bit Kernel Linux 3.5.0-27-generic
The instructions say that make (your cp2010x driver)
cp cp2010x.ko to /libmodules/<kernel>/kernel/driver/usb/serial
insmod /libmodules/<kernel>/kernel/driver/usb/serial/usbserial.ko
insmod xp2010x.ko
However, I get this error when I try to call make:
root#grace:/home/admin/Desktop/usb# make
make -C /lib/modules/3.5.0-27-generic/build M=/home/admin/Desktop/usb modules
make[1]: Entering directory `/usr/src/linux-headers-3.5.0-27-generic'
CC [M] /home/admin/Desktop/usb/cp210x.o
/home/admin/Desktop/usb/cp210x.c:164:12: error: ‘usb_serial_probe’ undeclared here (not in a function)
/home/admin/Desktop/usb/cp210x.c:165:16: error: ‘usb_serial_disconnect’ undeclared here (not in a function)
/home/admin/Desktop/usb/cp210x.c: In function ‘cp210x_init’:
/home/admin/Desktop/usb/cp210x.c:989:2: error: implicit declaration of function ‘usb_serial_register’ [-Werror=implicit-function-declaration]
/home/admin/Desktop/usb/cp210x.c:996:3: error: implicit declaration of function ‘usb_serial_deregister’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [/home/admin/Desktop/usb/cp210x.o] Error 1
make[1]: *** [_module_/home/admin/Desktop/usb] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.5.0-27-generic'
make: *** [all] Error 2
I am new to Linux. I've Googled the error a lot but I can't find any answers that works.
According to this forum post, those drivers have actually been a part of the kernel since March 2009. You can see the file at drivers/usb/serial/cp210x.c (here is a link to the file in the latest stable version of the kernel).

Error compiling imapfilter 2.4.1 in CentOS 5.6

I am trying to compile imapfilter 2.4.1 ( https://github.com/lefcha/imapfilter ) in CentOS 5.6. I believe I've got all the dependencies sorted but when I run make I get:
make[1]: Entering directory `/home/src/imapfilter-2.4.1/src'
cc -Wall -O -DMAKEFILE_SHAREDIR='"/usr/local/share/imapfilter"' -c -o core.o core.c
core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’
core.c: In function ‘ifcore_append’:
core.c:947: warning: implicit declaration of function ‘lua_strlen’
core.c: In function ‘luaopen_ifcore’:
core.c:1162: warning: implicit declaration of function ‘luaL_register’
core.c:1162: error: ‘ifcorelib’ undeclared (first use in this function)
core.c:1162: error: (Each undeclared identifier is reported only once
core.c:1162: error: for each function it appears in.)
make[1]: *** [core.o] Error 1
make[1]: Leaving directory `/home/src/imapfilter-2.4.1/src'
make: *** [all] Error 2
Based on other user comments and file revision dates I am sure this should compile. I am guessing I'm missing a library somewhere. I'll appreciate any help I can get on this.
Starting from first error message:
core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’
Line 41 of core.c is:
static const luaL_reg ifcorelib[] = {
Cryptic message from gcc means that it knows nothing about what is the luaL_reg and it thinks that it is variable name. Then it goes into panic when reads second variable name in the same definition/declaration. luaL_reg should be something like struct.
So, it seems that your problems are located in LUA development headers. May be you have too old or even to modern Lua package.
The imapfilter's github's readme says:
Compile time requirements are Lua (version 5.1)
Are you sure that your lua is 5.1 and the lua-devel (or any other package with lua headers) is 5.1 too?

Resources