Compiling the headless version of Espers using makefile.unix fails with the following error:
net.cpp:39:25: error: ‘cs_mapLocalHost’ was declared ‘extern’ and later ‘static’ [-fpermissive]
static CCriticalSection cs_mapLocalHost;
^~~~~~~~~~~~~~~
In file included from net.cpp:8:0:
net.h:134:25: note: previous declaration of ‘cs_mapLocalHost’
extern CCriticalSection cs_mapLocalHost;
^~~~~~~~~~~~~~~
net.cpp:40:40: error: ‘mapLocalHost’ was declared ‘extern’ and later ‘static’ [-fpermissive]
static map<CNetAddr, LocalServiceInfo> mapLocalHost;
^~~~~~~~~~~~
In file included from net.cpp:8:0:
net.h:135:40: note: previous declaration of ‘mapLocalHost’
extern map<CNetAddr, LocalServiceInfo> mapLocalHost;
^~~~~~~~~~~~
In file included from util.h:16:0,
from chainparams.h:11,
from net.cpp:6:
tinyformat.h: In static member function ‘static const char* tinyformat::detail::FormatIterator::streamStateFromFormat(std::ostream&, unsigned int&, const char*, int, int)’:
tinyformat.h:785:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
out.setf(std::ios::uppercase);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
tinyformat.h:786:9: note: here
case 'x': case 'p':
^~~~
tinyformat.h:791:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
out.setf(std::ios::uppercase);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
tinyformat.h:792:9: note: here
case 'e':
^~~~
tinyformat.h:797:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
out.setf(std::ios::uppercase);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
tinyformat.h:798:9: note: here
case 'f':
^~~~
tinyformat.h:802:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
out.setf(std::ios::uppercase);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
tinyformat.h:803:9: note: here
case 'g':
^~~~
makefile.unix:202: recipe for target 'obj/net.o' failed
make: *** [obj/net.o] Error 1
Compiling the headless version of Espers using
makefile.unix
fails with the following error:System is GCC 7 on Ubuntu 18.04.
More info about the general error here: https://stackoverflow.com/questions/40419244/error-extern-and-later-static