Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with latest release on Bullseye #530

Open
xianrecords2015 opened this issue Jan 10, 2025 · 1 comment
Open

Issue with latest release on Bullseye #530

xianrecords2015 opened this issue Jan 10, 2025 · 1 comment

Comments

@xianrecords2015
Copy link

I am running Bullseye on a Raspberry PI. Prior to 2 weeks ago, I had no issue with compiling my program with that install of MQTT and now, I am getting the following error messages:

g++ -c -o corinmqtt.o corinmqtt.cpp -I/usr/include/boost -I/home/pi/commmodule/spdlog/include -Wall -g -Wno-narrowing -DPAHO_BUILD_SAMPLES=FALSE
In file included from /usr/local/include/mqtt/message.h:34,
from /usr/local/include/mqtt/delivery_token.h:30,
from /usr/local/include/mqtt/callback.h:31,
from /usr/local/include/mqtt/async_client.h:45,
from corinmqtt.h:11,
from corinmqtt.cpp:1:
/usr/local/include/mqtt/properties.h:101:57: error: ‘string_view’ is not a member of ‘std’
101 | PAHO_MQTTPP_EXPORT static const std::map<code, std::string_view> TYPE_NAME;
| ^~~~~~~~~~~
/usr/local/include/mqtt/properties.h:101:57: note: ‘std::string_view’ is only available from C++17 onwards
/usr/local/include/mqtt/properties.h:101:57: error: ‘string_view’ is not a member of ‘std’
/usr/local/include/mqtt/properties.h:101:57: note: ‘std::string_view’ is only available from C++17 onwards
/usr/local/include/mqtt/properties.h:101:68: error: template argument 2 is invalid
101 | PAHO_MQTTPP_EXPORT static const std::map<code, std::string_view> TYPE_NAME;
| ^
/usr/local/include/mqtt/properties.h:101:68: error: template argument 4 is invalid
/usr/local/include/mqtt/properties.h:184:10: error: ‘string_view’ in namespace ‘std’ does not name a type
184 | std::string_view type_name() const;
| ^~~~~~~~~~~
/usr/local/include/mqtt/properties.h:184:5: note: ‘std::string_view’ is only available from C++17 onwards
184 | std::string_view type_name() const;
| ^~~
In file included from /usr/local/include/mqtt/async_client.h:46,
from corinmqtt.h:11,
from corinmqtt.cpp:1:
/usr/local/include/mqtt/create_options.h:52:31: error: ‘variant’ in namespace ‘std’ does not name a template type
52 | using persistence_type = std::variant<no_persistence, string, iclient_persistence*>;
| ^~~~~~~

@fpagliughi
Copy link
Contributor

The code is moving forward. As the README states...

The latest update moves the code base to C++17

and required tools:

A fully-compatible C++17 compiler

If I'm not mistaken, Bullseye shipped gcc v10, which default to C++14. To tell it to use the correct version, add the compiler flag:

-std=c++17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants