Install OpenCV-2.4.9 on CentOS 7 (PC) - linux

I'm trying to install OpenCV-2.4.9 on CentOS 7 (PC) however getting error after 16% when running "make" command. I leave default configuration for OpenCV.
make
...
[ 16%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_v4l.cpp.o /opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:306:29: error: field ‘capability’ has incomplete type
struct video_capability capability;
^ /opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:307:29: error: field ‘captureWindow’ has incomplete type
struct video_window captureWindow;
....
....
/opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp: In function ‘void icvCloseCAM_V4L(CvCaptureCAM_V4L*)’:
/opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:2812:46: error: ‘CvCaptureCAM_V4L’ has no member named ‘memoryBuffer’

It seems that the define HAVE_CAMV4L has the value 1, if you look in the file modules/highgui/src/cap_v4l.cpp looking for the structure definition at the row 306. If the compilation fails at that point this means that the video4linux development configuration is corrupted.
Using google I have found that the OpenCV Bug #1357 is described as follow:
CHECK_INCLUDE_FILE(linux/videodev.h HAVE_CAMV4L) succeeds even though linux/videodev.h doesn't exist on the system. (Bug #1357)
http://code.opencv.org/issues/1357
Anyway the solution is described at the same URL for "HAVE_CAMV4L gets set incorrectly": "Setting it to FALSE in CMakeLists.txt fixes the problem".

Related

Connecting Sparkfun ESP8266 Thing to Azure IoT Hub

I am currently trying to connect my Sparkfun ESP8266 Thing to my Azure IoT Hub. I have successfully set up my hub, and am following this tutorial on how to connect the Thing to my Azure IoT Hub: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-sparkfun-esp8266-thing-dev-get-started
Unfortunately I keep getting the error:
'StaticJsonBuffer' was not declared in this scope
Arduino: 1.8.5 (Windows 10), Board: "SparkFun ESP8266 Thing, 80 MHz, 512K (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
Build options changed, rebuilding all
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino: In function 'bool readMessage(int, char*)':
message:46: error: 'StaticJsonBuffer' was not declared in this scope
StaticJsonBuffer<MESSAGE_MAX_LEN> jsonBuffer;
^
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:46:5: note: suggested alternative:
In file included from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/StaticJsonDocument.hpp:8:0,
from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson.hpp:10,
from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson.h:9,
from C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:2:
C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/Memory/StaticJsonBuffer.hpp:110:7: note: 'ArduinoJson::Internals::StaticJsonBuffer'
class StaticJsonBuffer : public Internals::StaticJsonBufferBase {
^
message:46: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<MESSAGE_MAX_LEN> jsonBuffer;
^
message:74: error: 'class ArduinoJson::JsonObject' has no member named 'printTo'
root.printTo(payload, MESSAGE_MAX_LEN);
^
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino: In function 'void parseTwinMessage(char*)':
message:80: error: 'StaticJsonBuffer' was not declared in this scope
StaticJsonBuffer<MESSAGE_MAX_LEN> jsonBuffer;
^
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:80:5: note: suggested alternative:
In file included from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/StaticJsonDocument.hpp:8:0,
from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson.hpp:10,
from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson.h:9,
from C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:2:
C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/Memory/StaticJsonBuffer.hpp:110:7: note: 'ArduinoJson::Internals::StaticJsonBuffer'
class StaticJsonBuffer : public Internals::StaticJsonBufferBase {
^
message:80: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<MESSAGE_MAX_LEN> jsonBuffer;
^
message:82: error: 'class ArduinoJson::JsonObject' has no member named 'success'
if (!root.success())
^
message:88: error: 'ArduinoJson::Internals::enable_if >::type' has no member named 'success'
if (root["desired"]["interval"].success())
^
exit status 1
'StaticJsonBuffer' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I have changed the DEVICE_ID from "SparkFun ESP8266 Thing Dev" to "SparkFun ESP8266 Thing", and am using simulated data.
Any help with this would be much appreciated!
The reason for this error is that you install the ArduinoJson version >= 6. Default version 6.2.3-beta will be installed but from version 6 and higher JsonBuffer is replaced with JsonDocument. It is also indicate in the error message:
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:46:5:
note: suggested alternative:
In file included from
C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/StaticJsonDocument.hpp:8:0
To solve this issue you can roll back to the previous version. Version 5.13.2 works for me.
Reference issue on ArduinoJson repo and issue on iot-hub-feather-huzzah-client-app repo.

Error when building Automotive Grade Linux

I'm trying to build automotive grade linux, but I keep getting the same errors.
I tried building on different machines with different linux distributions, but I keep getting the error nevertheless.
I also tried building for different machines without success.
This is the full log of the last time I tried to build automotive grade linux for a raspberry pi 2:
Pt 1: https://pastebin.com/0pqKDdv5
Pt 2: https://pastebin.com/dmRCtTLe
This is my build configuration:
BB_VERSION = "1.32.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Debian-9.3"
TARGET_SYS = "arm-agl-linux-gnueabi"
MACHINE = "raspberrypi2"
DISTRO = "poky-agl"
DISTRO_VERSION = "4.0.2"
TUNE_FEATURES = "arm armv7ve vfp thumb neon vfpv4 callconvention-hard"
TARGET_FPU = "hard"
meta-raspberrypi = "HEAD:28d4404f89eb59d406b4976c0e3f5ca19137ba74"
meta-netboot = "HEAD:a5f69d3d31e7d75351f0e2abfc36d35ba39ce304"
meta-security-smack
meta-security-framework = "HEAD:20bbb97f6d5400b126ae96ef446c3e60c7e16285"
meta-app-framework = "HEAD:a5f69d3d31e7d75351f0e2abfc36d35ba39ce304"
meta-qt5 = "HEAD:5f837b47f5c3e462f24cd5abf58ff6ef1dd04932"
meta-agl-demo = "HEAD:65619655cb3f373a1b15da7a4d91191a2867464b"
meta-oe
meta-multimedia
meta-efl
meta-networking
meta-python
meta-filesystems = "HEAD:fe5c83312de11e80b85680ef237f8acb04b4b26e"
meta-ivi-common
meta-agl
meta-agl-distro
meta-agl-bsp = "HEAD:a5f69d3d31e7d75351f0e2abfc36d35ba39ce304"
meta
meta-poky = "HEAD:60402978fe3648bf560b3386c6e9dd661cdf2083"
This is the first error I get:
WARNING: qemu-native-2.7.0-r1 do_populate_sysroot: File '/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/openbios-ppc' from qemu-native was already stripped, this will prevent future debugging!
WARNING: qemu-native-2.7.0-r1 do_populate_sysroot: File '/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/openbios-sparc32' from qemu-native was already stripped, this will prevent future debugging!
WARNING: qemu-native-2.7.0-r1 do_populate_sysroot: File '/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/openbios-sparc64' from qemu-native was already stripped, this will prevent future debugging!
WARNING: qemu-native-2.7.0-r1 do_populate_sysroot: File '/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/s390-ccw.img' from qemu-native was already stripped, this will prevent future debugging!
WARNING: qemu-native-2.7.0-r1 do_populate_sysroot: File '/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/u-boot.e500' from qemu-native was already stripped, this will prevent future debugging!
ERROR: qemu-native-2.7.0-r1 do_populate_sysroot: runstrip: ''strip' --remove-section=.comment --remove-section=.note '/.../build/tmp/work/x86_64-linux/qemu-native/2.7.0-r1/sysroot-destdir/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/palcode-clipper'' strip command failed with 1 (b"strip: Unable to recognise the format of the input file `/.../build/tmp/work/x86_64-linux/qemu-native/2.7.0-r1/sysroot-destdir/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/palcode-clipper'\n")
This is the second error, which I think is caused by the first one.
ERROR: gcc-runtime-6.2.0-r0 do_compile: oe_runmake failed
ERROR: gcc-runtime-6.2.0-r0 do_compile: Function failed: do_compile (log file is located at /.../build/tmp/work/armv7vehf-neon-vfpv4-agl-linux-gnueabi/gcc-runtime/6.2.0-r0/temp/log.do_compile.30447)
ERROR: Logfile of failure stored in: /.../build/tmp/work/armv7vehf-neon-vfpv4-agl-linux-gnueabi/gcc-runtime/6.2.0-r0/temp/log.do_compile.30447
NOTE: recipe gcc-runtime-6.2.0-r0: task do_compile: Failed
ERROR: Task (/.../poky/meta/recipes-devtools/gcc/gcc-runtime_6.2.bb:do_compile) failed with exit code '1'
I found this thread of someone having the same issue, but there is no fix there, so I thought I'd ask it again, because this issue still persist.
I can see that there is a problem with the stripping of files, but I can't find where to fix this in the recipes.
I'm not sure if this error is caused by the used host system or if it's dependant on the recipes.
I hope someone knows a fix to this issue.
Thanks in advance
Laurens Wuyts
EDIT:
Here is the log file of the gcc error: https://www.dropbox.com/s/4hd5kzgbadhdc9p/log.do_compile.30447?dl=0
Here is the specific error message on pastebin:
https://pastebin.com/H8M3sY6a

reference console_loglevel ERROR in kernel module

I have a Linux module, which has a debug function and I just want to call that function in debug mode.
Now I have code like this:
if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG)
dump_my_message(dev, my_msg);
But when build this code in linux-next, it will throw below error:
CHK include/generated/uapi/linux/version.h
Kernel: arch/x86/boot/bzImage is ready (#2)
Building modules, stage 2.
MODPOST 2738 modules
ERROR: "console_printk" [drivers/mymodule.ko] undefined!
scripts/Makefile.modpost:91: recipe for target '__modpost' failed
make[1]: *** [__modpost] Error 1
Makefile:1117: recipe for target 'modules' failed
make: *** [modules] Error 2
Can you help to find out how to make this work? thanks!!!
The compilation error is caused by the fact that console_printk symbol is not exported so it cannot be used by modules.
What you really should use, however, is Dynamic debug functionality and its pr_debug()/dev_dbg() functions.
Basically what you need is to ensure that CONFIG_DYNAMIC_DEBUG is enabled in your kernel, use dev_dbg() in all places where you want to write some debugging code and then dynamically enable your debug messages, for example:
To enable all the messages in your module, add dyndbg=+p at the end of your insmod/modprobe call.
To selectively enable only some of the messages, use query language described in the documentation. For example, to only enable messages from functions foo() and bar() in your module, use:
insmod mymodule.ko dyndbg="func foo +p; func bar +p"

preverify:ERROR: floating-point constants should not appear, while running the code in j2me using netbeans 6.9

all I am making a new project in J2ME-Polish2.1.4 and when I create a new project using J2ME-Polish2.1.4, the build is successful but when i run this code then I see the error about floating-point constants with more details below.
How to recover from this issue?
`J2ME Polish 2.1.4 (2010-01-18) (GPL License)
Loading device database...
Last build was interrupted or failed, now clearing work directory...
using locale [en_US]...
assembling resources for device [Nokia/7610].
preprocessing for device [Nokia/7610].
processing locale code...
compiling for device [Nokia/7610].
warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
Compiling 428 source files to D:\Faraz\development\J2ME-Polish-Projectaaaa\build\test\Nokia\7610\en_US\classes
preverifying for device [Nokia/7610].
preverify:ERROR: floating-point constants should not appear
preverify:Error preverifying class de.enough.polish.ui.screenanimations.CubeScreenChangeAnimation
Preverify call failed: 1
C:\WTK2.5.1\bin\preverify.exe -classpath d:\J2ME-Polish2.1.4\import\mmapi.jar;d:\J2ME-Polish2.1.4\import\cldc-1.0.jar;d:\J2ME-Polish2.1.4\import\midp-2.0.jar;d:\J2ME-Polish2.1.4\import\nokia-ui.jar;d:\J2ME-Polish2.1.4\import\wmapi-2.0.jar;d:\J2ME-Polish2.1.4\import\wmapi.jar;d:\J2ME-Polish2.1.4\import\btapi.jar;d:\J2ME-Polish2.1.4\import\m3g.jar;d:\J2ME-Polish2.1.4\import\jsr172.jar;d:\J2ME-Polish2.1.4\import\fileconnection.jar;d:\J2ME-Polish2.1.4\import\pim.jar;d:\J2ME-Polish2.1.4\import\m2g.jar -d D:\Faraz\development\J2ME-Polish-Projectaaaa\build\test\Nokia\7610\en_US\classes -nofp -nofinalize -nonative D:\Faraz\development\J2ME-Polish-Projectaaaa\build\test\Nokia\7610\en_US\classes
D:\Faraz\development\J2ME-Polish-Projectaaaa\build.xml:87: Unable to preverify for device [Nokia/7610] - preverify returned result 1
BUILD FAILED (total time: 9 seconds)
`
If you look deeper into preferify classpath, there is an indication of what caused the error.
C:\WTK2.5.1\bin\preverify.exe -classpath d:\J2ME-Polish2.1.4\import\mmapi.jar;d:\J2ME-Polish2.1.4\import\cldc-1.0.jar;d:\J2ME-Polish2.1.4\import\midp-2.0.jar;d:\J2ME-Polish2.1.4\import\nokia-ui.jar;d:\J2ME-Polish2.1.4\import\wmapi-2.0.jar;d:\J2ME-Polish2.1.4\import\wmapi.jar;d:\J2ME-Polish2.1.4\import\btapi.jar;d:\J2ME-Polish2.1.4\import\m3g.jar;d:\J2ME-Polish2.1.4\import\jsr172.jar;d:\J2ME-Polish2.1.4\import\fileconnection.jar;d:\J2ME-Polish2.1.4\import\pim.jar;d:\J2ME-Polish2.1.4\import\m2g.jar -d D:\Faraz\development\J2ME-Polish-Projectaaaa\build\test\Nokia\7610\en_US\classes -nofp -nofinalize -nonative D:\Faraz\development\J2ME-Polish-Projectaaaa\build\test\Nokia\7610\en_US\classes
Above refers to cldc-1.0.jar meaning that your build is configured for CLDC 1.0 where floating point is not supported indeed. That's why your build fails.
To get it fixed, either get rid of floating point code in your application or use CLDC 1.1 that allows for float and double.

Cannot build "cyrus-sasl-2.1.23" on SUSE Linux 10.0

I downloaded the source code from "ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/".
Configure went well but when i build I end up with following errors:
digestmd5.c:852: error: 'des_context_t' has no member named 'keysched'
digestmd5.c:853: error: 'des_context_t' has no member named 'keysched2'
digestmd5.c:854: error: 'des_context_t' has no member named 'ivec'
digestmd5.c:855: error: 'DES_DECRYPT' undeclared (first use in this function)
....
Well i guess configuration issues.
I configured it with following settings and it worked.
./configure --prefix= (PATH) --exec-prefix=(PATH) --with-dblib=no --without-des --with-openssl=(PATH)

Resources