Hi,
I developed a C++ library that compiles on many platforms (Linux and Windows on PCs, Buildroot Linux on ARM). The only dependency of this library is the standard C++ library. I’m trying to compile it with the native board, to start with. The real target will be ESP32S3 DevKit board, whose compiler does provide libstdc++.
I created a package in my test project directory under pkg/librst
.
The compilation outputs a whole lot of errors, the first one being error: unknown type name ‘namespace’. A dry run (make -n
) tells me that gcc is called, but I expect g++ to be called. Yet, I did add the cpp and libstdcpp dependencies to FEATURES_REQUIRED
.
I’m really stuck, here. Any idea ?
Files in the package
Makefile
PKG_NAME = librst
PKG_URL = https://...
PKG_VERSION = f84e0d...
PKG_LICENSE = proprietary
include $(RIOTBASE)/pkg/pkg.mk
all:
$(info $$PKG_SOURCE_DIR = ${PKG_SOURCE_DIR})
$(info BINDIR = ${BINDIR})
$(info BOARD = ${BOARD})
# copy library's include files to BINDIR :
mkdir -p $(BINDIR)/$(PKG_NAME)/include
cp $(PKG_SOURCE_DIR)/*.h $(BINDIR)/$(PKG_NAME)/include
$(MAKE) -C $(PKG_SOURCE_DIR) -f $(RIOTBASE)/Makefile.base
Makefile.include
CFLAGS += -DEXTERNAL_PKG_LIBRST
INCLUDES += -I$(BINDIR)/librst/include
INCLUDES += -I/usr/include/c++/13
INCLUDES += -I/usr/include/x86_64-linux-gnu/c++/13
Makefile.dep
FEATURES_REQUIRED += cpp
FEATURES_REQUIRED += libstdcpp