-bash: /usr/bin/gcc: Input/output error - c++

I am using debian on bananaPi. Yesterday, I ran an object file (which I already had build a few days ago), and it was working fine. Now I made some changes to the source and when I tried to build the file it is giving this error:
-bash: /usr/bin/gcc: Input/output error
This is the command which I used to build the file:
gcc sensor.c -o result -lwiringPi -lsqlite3 -lrt

Related

Boost cross compilation with custom Yocto SDK fails with "No such file or directory" errors

I've been given a custom Yocto SDK so as to build a c++ app I've created and the third party libraries that the app depends on.
I've installed the SDK on a VM Ubuntu 16.04.
The first library I needed to build was boost. I use version. 1.64.
I follow the same steps I follow each time to build boost either on a Yocto SDK or a default arm compiler.
$ . /opt/environment-setup-poky-linux-gnueabi
$ ./bootstrap.sh --with-libraries=filesystem,iostreams,program_options,regex,system --prefix=/home/user/Libs
$ nano ~/user-config.jam where I place the following commands
$ using gcc : arm : /opt/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ --sysroot= /opt/sysroots/arm-poky-linux-gnueabi ;
$ ./b2 install toolset=gcc-arm link=shared threading=multi
However I always get the following error :
gcc.compile.c++ bin.v2/libs/system/build/gcc-arm/release/threading-multi/error_code.o
In file included from /opt/sysroots/arm-poky-linux-gnueabi/usr/include/gnu/stubs.h:55,
from /opt/sysroots/arm-poky-linux-gnueabi/usr/include/features.h:452,
from /opt/sysroots/arm-poky-linux-gnueabi/usr/include/c++/8.2.0/arm-poky-linux-gnueabi/bits/os_defines.h:39,
from /opt/sysroots/arm-poky-linux-gnueabi/usr/include/c++/8.2.0/arm-poky-linux-gnueabi/bits/c++config.h:508,
from /opt/sysroots/amr-poky-linux-gnueabi/usr/include/c++/8.2.0/cstddef:49,
from ./boost/config/compiler/gcc.hpp:165,
from ./boost/config.hpp:39,
from ./boost/system/config.hpp:13,
from ./boost/system/error_code.hpp:14,
from libs/system/src/error_code.cpp:16:
/opt/sysroots/arm-poky-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
# include <gnu/stubs-soft.h>
^~~~~~~~~~~~~~~~~~
I assume that the sysroot is not found correctly.
When I tried with a user-config.jam that does not contain --sysroot variable I get the error :
gcc.compile.c++ bin.v2/libs/system/build/gcc-arm/release/threading-multi/error_code.o
In file included from ./boost/config.hpp:39,
from ./boost/system/config.hpp:13,
from ./boost/system/error_code.hpp:14,
from libs/system/src/error_code.cpp:16:
./boost/config/compiler/gcc.hpp:165:10: fatal error: cstddef: No such file or directory
#include <cstddef>
^~~~~~~~~
compilation terminated.
The CC variable on the environment setup contains the follwoing:
export CC="arm-poky-linux-gnueabi-gcc -march=armv7ve -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=$SDKTARGETSYSROOT"
Is there something I can do to bypass these errors or the SDK is faulty and needs rebuilt ?
Thanks in advance

OpenCV + Eclipse on Linux - Build issues

I downloaded opencv from here and extracted it to /home/XXXX/Documents/opencv-4.4.0.
I want to link it to Eclipse. So I did this -
In the project settings -> GCC C++ Compiler -> include path I gave /home/XXXX/Documents/opencv-4.4.0.
Then in the linker section I added the libraries and set the library search path to /home/XXXX/Documents/opencv-4.4.0 and even /home/XXXX/Documents/opencv-4.4.0/include.
When I build the project, I get this error -
18:50:10 **** Incremental Build of configuration Debug for project displayImage ****
make all
Building file: ../src/displayIMage.cpp
Invoking: GCC C++ Compiler
g++ -I/home/XXXX/Documents/opencv-4.4.0 -I/home/XXXX/Documents/opencv-4.4.0/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/displayIMage.d" -MT"src/displayIMage.o" -o "src/displayIMage.o" "../src/displayIMage.cpp"
In file included from ../src/displayIMage.cpp:1:
/home/XXXX/Documents/opencv-4.4.0/include/opencv2/opencv.hpp:48:10: fatal error: opencv2/opencv_modules.hpp: No such file or directory
48 | #include "opencv2/opencv_modules.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [src/subdir.mk:20: src/displayIMage.o] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
I followed everything according to this tutorial. I tried running pkg-config --cflags opencv to find the right paths but that gave me this error -
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
What am I doing wrong?

Is it possible to compile c++ using Clang only on windows?

I really tried a lot. Clang does not come with standard C++ includes, and obviously can not find them :
clang++ file.cpp -o file.out
C:\Folder\file.cpp:1:11: fatal error: 'iostream' file not found
#include <iostream>
^
1 error generated.
Passing the mingw includes by arguments, it returns another error:
clang++ -target x86_64-w64-mingw32 C:\Folder\file.cpp -IC:\MinGW\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++ -IC:\MinGW\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++\x86_64-w64-mingw32 -IC:\MinGW\mingw64\x86_64-w64-mingw32\include -o C:\Folder\file.out -std=c++11
clang++.exe: error: unable to execute command: program not executable
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
When I use -c it does not use the linker and also not generate an executable file.
Edit : I'm running on windows
Run your commands from "x64 Native Tools Command Prompt for VS 2017", or something similar. It will setup some required env vars for you.

python installation "cc1.exe: error: unrecognized command line option '-mno-cygwin'"

Hi guys i'm trying to install rrdtool (for PYTHON 2.7) on my windows 7 system , i install it using this command line.
python setup.py install build --compiler=mingw32
it gives me the following output:
running install
running build
running build_ext
running build_configure
building 'rrdtoolmodule' extension
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Irrdtool-1.4.7/src -IC:\Python2
7\include -IC:\Python27\PC -c rrdtool-1.4.7/bindings/python/rrdtoolmodule.c -o b
uild\temp.win32-2.7\Release\rrdtool-1.4.7\bindings\python\rrdtoolmodule.o
cc1.exe: error: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1
i have tried many solutions to solve this, but had no success.i'm using mingw version 4.6.2
can anyone pls help me .
See this answer: https://stackoverflow.com/a/6035864/1516291
you need to edit distutils\cygwinccompiler.py in your Python directory to remove all instances of -mno-cygwin
good luck

Compiling Festival on MingW32

I'm trying to compile Festival on MingW32, so I can have a Windows binary. I couldn't find the Windows binary on their site. Anyone have one they can post?
If not, here's what I have so far. I did the ./configure and make for it and have the following message:
$ make
config/config:43: ../speech_tools/config/config: No such file or directory
So, I downloaded the speech_tools tar ball and got. Did the ./configure and make to get:
$ make
config/config:156: config/systems/ix86_unknown.mak: No such file or directory
../config/config:156: ../config/systems/ix86_unknown.mak: No such file or directory
make: *** No rule to make target `../config/systems/ix86_unknown.mak'. Stop.
config/rules/modules.mak:133: config/modincludes.inc: No such file or directory
make --no-print-directory -C ./config MADE_FROM_ABOVE=1 MODINCLUDES=1 INCLUDE_EVERYTHING='' modincludes.inc
../config/config:156: ../config/systems/ix86_unknown.mak: No such file or directory
make[1]: *** No rule to make target `../config/systems/ix86_unknown.mak'. Stop.
make: *** [config/modincludes.inc] Error 2
So, I copied config/systems/ix86_CYGWIN32.mak to ix86_unknown.mak and tried again. Now I get this message:
g++ -c -fno-implicit-templates -O3 -Wall -Wno-non-template-friend -Wno-deprecated -DSUPPORT_EDITLINE -I../include slib.cc
In file included from slib.cc:85:
../include/EST_unix.h:53:25: sys/wait.h: No such file or directory
../include/EST_unix.h:54:29: sys/resource.h: No such file or directory
In file included from ../include/EST_String.h:50,
from ../include/siod.h:17,
from slib.cc:88:
../include/EST_iostream.h:54:26: strstream.h: No such file or directory
In file included from ../include/EST_TList.h:50,
from ../include/EST_string_aux.h:43,
from ../include/siod.h:18,
from slib.cc:88:
Where do I get sys/wait.h, sys/resource.h and strstream.h? I'd rather not have to try this whole bit in Cygwin and carry around those annoying DLL's. Any advice?
Windows binaries are available here
You'll get further with a full cygwin install instead of just mingwin, but I can't promise success.
I run Ubuntu and remember having Festival available in the Synaptics repository, implying I just had to double click the name, and the thing installed itself with all its dependencies.
If all else fails, you might want to run a VM with ubuntu or dual boot.