Я пытаюсь включить библиотеку PAHO MQTT C ++ в пример приложения octane etk (которое находится на C ++), предоставляемого IMPINJ .
Я выполнил шаги, описанные на портале Impinj, чтобы создать пример приложения, и я могу прочитать информацию тега, тогда как при попытке включить библиотеку PAHO MQTT в пример приложения и когда я Создайте предоставленный образец приложения с помощью impinj:
root@mindlogic-VirtualBox:/home/user/octane_etk_sample-6.0.0.240# make
mkdir -p ./bin
g++ \
-m32 -Wno-write-strings \
-Iinclude \
speedway_embedded_example.cpp \
-Llib -lltkcpp_x86 -lltkcppimpinj_x86 -lxml2_x86 \
-L/usr/bin -ldl -lssl -lcrypto \
-o bin/speedwayr_x86
In file included from /usr/include/c++/4.8/chrono:35:0,
from /usr/local/include/mqtt/types.h:29,
from /usr/local/include/mqtt/async_client.h:29,
from speedway_embedded_example.cpp:23:
/usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
In file included from include/ltkcpp.h:41:0,
from speedway_embedded_example.cpp:19:
include/version.inc:1:21: error: too many decimal points in number
#define VERSION_STR 10.34.0.0
^
In file included from /usr/local/include/mqtt/async_client.h:29:0,
from speedway_embedded_example.cpp:23:
/usr/local/include/mqtt/types.h:37:7: error: expected nested-name-specifier before ‘byte’
using byte = uint8_t;
Может ли кто-нибудь помочь мне включить C ++ 11?
Ниже приведено содержимое MakeFile,
SOURCES = speedway_embedded_example.cpp
LIB_DIR = /usr/bin
MPNJ_LIB_DIR = lib
HEADER_DIR = include
ETK_DEFAULT_INSTALL_DIR = /home/etk/impinj_etk
INSTALL_TOOL_HELP = \
"Failed to find the arm-none-linux-gnueabi-g++ compiler." \
"Please make sure that /home/etk/impinj_etk/arm-toolchain/bin is in your PATH."
INSTALL_ETK_HELP = "Please follow the ETK install instructions and make sure that" \
"/home/etk/impinj_etk is in your PATH, or that the ETK_INSTALL_DIR is defined."
# The cap_gen tool may be in the PATH, the install dir, or in the current dir.
CAP_GEN_EXE = cap_gen.sh
CAP_GEN_IN_PATH=$(shell which $(CAP_GEN_EXE))
CAP_GEN_CWD=$(shell ls ./$(CAP_GEN_EXE) 2>/dev/null)
CAP_GEN_DEFAULT=$(shell ls $(ETK_DEFAULT_INSTALL_DIR)/$(CAP_GEN_EXE) 2>/dev/null)
ifneq (,$(CAP_GEN_IN_PATH))
CAP_GEN=$(CAP_GEN_IN_PATH)
else
ifneq (,$(ETK_INSTALL_DIR))
CAP_GEN=$(ETK_INSTALL_DIR)/$(CAP_GEN_EXE)
else
ifneq (,$(CAP_GEN_DEFAULT))
CAP_GEN=$(CAP_GEN_DEFAULT)
else
ifneq (,$(CAP_GEN_CWD))
CAP_GEN=$(CAP_GEN_CWD)
endif
endif
endif
endif
all: x86 arm
help:
@echo Example use:
@echo ‘make arm’ to build the sample for on-reader use
@echo ‘make x86’ to build the sample for the (x86) host
@echo ‘make cap’ to build a CAP upgrade file
bin/speedwayr_x86:
mkdir -p ./bin
g++ \
-m32 -Wno-write-strings \
-I$(HEADER_DIR) \
$(SOURCES) \
-L$(MPNJ_LIB_DIR) -lltkcpp_x86 -lltkcppimpinj_x86 -lxml2_x86 \
-L$(LIB_DIR) -ldl -lssl -lcrypto \
-o bin/speedwayr_x86
x86: bin/speedwayr_x86
bin/speedwayr_arm: check_env
mkdir -p ./bin
arm-none-linux-gnueabi-g++ \
-Wno-write-strings \
-I$(HEADER_DIR) \
$(SOURCES) \
-L$(MPNJ_LIB_DIR) \
-static -lltkcpp_atmel -lltkcppimpinj_atmel -lxml2_atmel \
-lssl_atmel -lcrypto_atmel -ldl_atmel \
-o bin/speedwayr_arm
arm-none-linux-gnueabi-strip bin/speedwayr_arm
arm: bin/speedwayr_arm
cap: arm check_env
$(CAP_GEN) -d cap_description.in -o speedwayr_cap.upg
clean:
rm -rf bin/*
rm -rf speedwayr_cap.upg
.PHONY: check_env
check_env:
@if ! which $(CAP_GEN_EXE) > /dev/null && \
[ ! -f $(ETK_INSTALL_DIR)/$(CAP_GEN_EXE) > /dev/null ] && \
[ ! -f ./$(CAP_GEN_EXE) > /dev/null ]; then \
echo "Failed to find $(CAP_GEN_EXE)."; \
echo $(INSTALL_ETK_HELP); \
exit 1; \
fi
@if ! which arm-none-linux-gnueabi-g++ > /dev/null; then \
echo $(INSTALL_TOOL_HELP); \
exit 1; \
fi
Примечание: - - Добавил -std = c ++ 11 для каждого g ++ в Makefile согласно предложению, данному @Mikel Rychliski, и получил ошибку ниже,
root@mindlogic-VirtualBox:/home/user/octane_etk_sample-6.0.0.240# make
mkdir -p ./bin
g++ \
-m32 -Wno-write-strings -std = c++11 \
-Iinclude \
speedway_embedded_example.cpp \
-Llib -lltkcpp_x86 -lltkcppimpinj_x86 -lxml2_x86 \
-L/usr/bin -ldl -lssl -lcrypto \
-o bin/speedwayr_x86
g++: error: =: No such file or directory
g++: error: c++11: No such file or directory
g++: error: unrecognized command line option ‘-std’
Makefile:45: recipe for target 'bin/speedwayr_x86' failed
make: *** [bin/speedwayr_x86] Error 1
Примечание 2 : Без пробела при добавлении -std = c ++ 11 получил ошибки как
root@mindlogic-VirtualBox:/home/mindlogic/octane_etk_sample-6.0.0.240# make
mkdir -p ./bin
g++ \
-m32 -Wno-write-strings -std=c++11 \
-Iinclude \
speedway_embedded_example.cpp \
-Llib -lltkcpp_x86 -lltkcppimpinj_x86 -lxml2_x86 \
-L/usr/bin -ldl -lssl -lcrypto \
-o bin/speedwayr_x86
In file included from include/ltkcpp.h:32:0,
from speedway_embedded_example.cpp:19:
include/ltkcpp_base.h:97:5: error: ‘llrp_u16_t’ does not name a type
llrp_u16_t m_nValue;