Archived
DataStorm compilation issue on MacOS - NodeI.cpp:476:24: error: loop variable 's' of type ... create
Hello and best wishes for the new year.
Observing following compilation error on MacOSX on DataStorm 0.2 cloned from github.
This is with Ice-3.7.4. binary distribution installed on MacOS Big Sur 11.1
Changing to "for(const auto &s : _subscribers)" 'avoids' the compilation error as stipulated by the recommendation given below.
Am I missing something about macosx specific config or version fetched from github?
datastorm % make
making all in cpp
Compiling [macosx-shared] src/DataStorm/NodeI.cpp
src/DataStorm/NodeI.cpp:476:24: error: loop variable 's' of type 'const std::__1::pair >' creates a copy from type 'const
std::__1::pair >'
[-Werror,-Wrange-loop-analysis]
for(const auto s : _subscribers)
^
src/DataStorm/NodeI.cpp:476:13: note: use reference type 'const std::__1::pair > &' to prevent copying
for(const auto s : _subscribers)
^~~~~~
&
src/DataStorm/NodeI.cpp:487:24: error: loop variable 's' of type 'const std::__1::pair >' creates a copy from type 'const
std::__1::pair >'
[-Werror,-Wrange-loop-analysis]
for(const auto s : _publishers)
^
src/DataStorm/NodeI.cpp:487:13: note: use reference type 'const std::__1::pair > &' to prevent copying
for(const auto s : _publishers)
^~~~~~
&
2 errors generated.
make[1]: *** [src/DataStorm/build/macosx/shared/pic/NodeI.o] Error 1
Comments
-
Many thanks - "working" (fast action - like in old times :-) ).
just a small copy/paste issue I think:
In demos/cpp/make/Make.rules
DATASTORM_HOME ?= /opt/DataStorm-3.7.0
should be changed to
DATASTORM_HOME ?= /opt/DataStorm-0.2.0
for bare consistency with the version numbersent pull request
Cheers
Manfred1