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

port/linux Make SWUPDATE=1 result --> error: anonymous variadic macros were introduced in C++11 [-Werror=variadic-macros] #3

Closed
liz7124 opened this issue Feb 12, 2020 · 4 comments
Labels
wontfix This will not be worked on

Comments

@liz7124
Copy link

liz7124 commented Feb 12, 2020

Hi.
I tried to build from Linux port for enable SWUPDATE resource.
So in <iotivity-lite>/port/linux, I ran make SWUPDATE=1, then got this error

-DOC_PKI -DOC_DYNAMIC_ALLOCATION -DOC_SOFTWARE_UPDATE -DOC_SECURITY -lm -pthread -lrt -lboost_system -lcppnetlib-uri
In file included from ../../port/oc_connectivity.h:24:0, from ../../include/oc_buffer.h:22, from ../../messaging/coap/coap.h:56, from ../../messaging/coap/separate.h:51, from ../../messaging/coap/oc_coap.h:20, from ../../include/oc_api.h:32, from ../../apps/smart_home_server_with_mock_swupdate.cpp:17: ../../include/oc_endpoint.h:77:62: error: anonymous variadic macros were introduced in C++11 [-Werror=variadic-macros] #define oc_make_ipv4_endpoint(__name__, __flags__, __port__, ...) ^
../../include/oc_endpoint.h:81:62: error: anonymous variadic macros were introduced in C++11 [-Werror=variadic-macros]
#define oc_make_ipv6_endpoint(__name__, __flags__, __port__, ...) ^
In file included from ../../port/oc_connectivity.h:27:0, from ../../include/oc_buffer.h:22, from ../../messaging/coap/coap.h:56, from ../../messaging/coap/separate.h:51, from ../../messaging/coap/oc_coap.h:20, from ../../include/oc_api.h:32, from ../../apps/smart_home_server_with_mock_swupdate.cpp:17: ../../port/oc_log.h:37:15: error: anonymous variadic macros were introduced in C++11 [-Werror=variadic-macros]
#define PRINT(...) printf(__VA_ARGS__) ^
../../port/oc_log.h:147:16: error: anonymous variadic macros were introduced in C++11 [-Werror=variadic-macros] #define OC_LOG(...) ^
../../port/oc_log.h:148:16: error: anonymous variadic macros were introduced in C++11 [-Werror=variadic-macros] #define OC_DBG(...) ^
../../port/oc_log.h:149:16: error: anonymous variadic macros were introduced in C++11 [-Werror=variadic-macros] #define OC_WRN(...) ^
../../port/oc_log.h:150:16: error: anonymous variadic macros were introduced in C++11 [-Werror=variadic-macros] #define OC_ERR(...) ^
../../apps/smart_home_server_with_mock_swupdate.cpp:33:33: fatal error: boost/network/uri.hpp: No such file or directory cc1plus: all warnings being treated as errors compilation terminated. Makefile:350: recipe for target 'smart_home_server_with_mock_swupdate' failed make: *** [smart_home_server_with_mock_swupdate] Error 1

@liz7124
Copy link
Author

liz7124 commented Feb 12, 2020

The last error cannot find file/directory in this #include <boost/network/uri.hpp>

@liz7124 liz7124 changed the title error: anonymous variadic macros were introduced in C++11 [-Werror=variadic-macros] port/linux Make SWUPDATE=1 result --> error: anonymous variadic macros were introduced in C++11 [-Werror=variadic-macros] Feb 12, 2020
@liz7124
Copy link
Author

liz7124 commented Feb 17, 2020

I upgraded my gcc to version 9.2.1 (before 5.4.0) and the first error solved.
But the last error still.
I've download libboost library sudo apt install libboost-all-dev but can't find the network/uri.hpp.
I've found in cppnetlib-uri (https://github.com/cpp-netlib/uri). But where should I copy this library?
I try to copy the network folder from cppnetlib-uri to /usr/include/boost/ then got this error

In file included from ../../apps/smart_home_server_with_mock_swupdate.cpp:33:
/usr/include/boost/network/uri.hpp:35:10: fatal error: network/uri/uri.hpp: No such file or directory
35 | #include <network/uri/uri.hpp>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

@georgen117
Copy link
Contributor

The "mock" sample uses a Boost library just to validate URIs.
You can fetch it from here: : https://cpp-netlib.org/

The netlib library has been proposed for inclusion in the Boost library but is not yet part of boost. It must be downloaded and installed separately. which is why sudo apt install libboost-all-dev did not resolve the build failure.

@WAvdBeek
Copy link
Contributor

The software update feature is now using a regex pattern to validate the URI.
Hence removed Boost and the cpp-netlib from the build command.
The code is still there if someone wants to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants