I'm trying to compile something from github: https://github.com/com2m/anki-overdrive-goes-iot/
When Running Qmake everthings seems fine, but whe in run make i get the follwoing error:
g++ -c -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_BLUETOOTH_LIB -DQT_CORE_LIB -I. -isystem /usr/include -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtBluetooth -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o main.o src/main.cpp
In file included from /usr/include/c++/7/bits/stl_algo.h:59:0,
from /usr/include/c++/7/algorithm:62,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:109,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qcoreapplication.h:43,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/QCoreApplication:1,
from src/main.cpp:6:
/usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
Makefile:497: recipe for target 'main.o' failed
make: *** [main.o] Error 1
The File i'm running qmake on is the ankidrive.pro file with the follwing content.
######################################################################
# Automatically generated by qmake (3.0) Thu Sep 29 10:34:51 2016
######################################################################
QT += bluetooth
QT += core
QT -= gui
CONFIG += c++11
CONFIG += debug
TEMPLATE = app
TARGET = build/ankioverdrive
#INCLUDEPATH += .
LIBS += -lmosquittopp
LIBS += -L/usr/lib
INCLUDEPATH += /usr/include/
# Input
SOURCES += src/main.cpp \
src/bluetoothcontroller.cpp \
src/ankimessage.cpp \
src/trackpiece.cpp \
src/track.cpp \
src/mqttclient.cpp \
src/json.cpp \
src/drivemode.cpp \
src/joystick.cc \
src/gamepadmanager.cpp \
src/ankicar.cpp \
src/racecar.cpp \
src/tragediyimplementation.cpp
HEADERS += \
src/headers/bluetoothcontroller.h \
src/headers/ankimessage.h \
src/headers/trackpiece.h \
src/headers/track.h \
src/headers/mqttclient.h \
src/headers/json.h \
src/headers/drivemode.h \
src/headers/joystick.hh \
src/headers/gamepadmanager.h \
src/headers/ankicar.h \
src/headers/racecar.h \
src/headers/tragediyimplementation.h
The makefile generated starts like this:
#############################################################################
# Makefile for building: build/ankioverdrive
# Generated by qmake (3.1) (Qt 5.9.5)
# Project: ankioverdrive.pro
# Template: app
# Command: /usr/lib/qt5/bin/qmake -o Makefile ankioverdrive.pro
#############################################################################
MAKEFILE = Makefile
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DQT_BLUETOOTH_LIB -DQT_CORE_LIB
CFLAGS = -pipe -g -Wall -W -D_REENTRANT -fPIC $(DEFINES)
CXXFLAGS = -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
INCPATH = -I. -isystem /usr/include -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtBluetooth -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++
QMAKE = /usr/lib/qt5/bin/qmake
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp -f
COPY_FILE = cp -f
COPY_DIR = cp -f -R
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = cp -f -R
QINSTALL = /usr/lib/qt5/bin/qmake -install qinstall
QINSTALL_PROGRAM = /usr/lib/qt5/bin/qmake -install qinstall -exe
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
TAR = tar -cf
COMPRESS = gzip -9f
DISTNAME = ankioverdrive1.0.0
DISTDIR = /home/renji/Projects/BachalorArbeit/anki-overdrive-goes-iot/.tmp/ankioverdrive1.0.0
LINK = g++
LFLAGS = -Wl,-rpath-link,/usr/lib/x86_64-linux-gnu
LIBS = $(SUBLIBS) -lmosquittopp -L/usr/lib -lQt5Bluetooth -lQt5Core -lpthread
AR = ar cqs
RANLIB =
SED = sed
STRIP = strip
My research showed that there must be something wrong with the inculude path, but the path i assigned is my c++ includepath.
The stdlib.h can be found under:
/usr/include/c++/7/stdlib.h
Im'm running Kubuntu 18.04 and the library build-essentials is already installed.
/usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
sudo apt install g++ g++-5 libmosquittopp-dev libbluetooth-dev qtconnectivity5-dev
git clone https://github.com/com2m/anki-overdrive-goes-iot.git
cd anki-overdrive-goes-iot/
export QT_SELECT=5
qmake // the Makefile is generated
// Edit Makefile line 13 to CC = gcc-5
// and line 14 to CXX = g++-5
make
No errors.
Your errors: I guess it's kind of a bug somewhere, since the g++-7 header /usr/include/c++/7/stdlib.h
is not found ? (Same issue with g++-6.)