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

Compilation fails with error: 'constexpr' needed for in-class initialization of static data member #25

Open
mike01 opened this issue Sep 25, 2018 · 4 comments

Comments

@mike01
Copy link

mike01 commented Sep 25, 2018

When compiling via "make" the following error message appears:

In file included from ../TRXManager/TRXManager.h:30:0,
from ../UMTS/UMTSL1CC.h:28,
from ../UMTS/UMTSL1FEC.h:28,
from ../UMTS/UMTSConfig.h:30,
from CLI.cpp:31:
../UMTS/UMTSRadioModem.h: At global scope:
../UMTS/UMTSRadioModem.h:181:28: error: 'constexpr' needed for in-class initialization of static data member 'const float UMTS::RadioModem::mRACHThreshold' of non-integral type [-fpermissive]
static const float mRACHThreshold = 10.0;
^~~~~~~~~~~~~~
CLI.cpp: In function 'CommandLine::CLIStatus CommandLine::sendsimple(int, char**, std::ostream&)':
CLI.cpp:480:137: warning: format '%u' expects argument of type 'unsigned int', but argument 13 has type 'size_t {aka long unsigned int' [-Wformat=]
SI, (unsigned)random(), srcAddr,srcAddr,sock.port(),(unsigned)random(), IMSI, (unsigned)random(),sock.port(), strlen(txtBuf), txtBuf);
~~~~~~~~~~~~~~ ^
CLI.cpp: At global scope:
CLI.cpp:270:18: warning: 'CommandLine::CLIStatus CommandLine::printStats(int, char**, std::ostream&)' declared 'static' but never defined [-Wunused-function]
static CLIStatus printStats(int argc, char** argv, ostream& os);
^~~~~~~~~~
CLI.cpp:1092:18: warning: 'CommandLine::CLIStatus CommandLine::endcall(int, char**, std::ostream&)' defined but not used [-Wunused-function]
static CLIStatus endcall(int argc, char argv, ostream& os)
^~~~~~~
CLI.cpp:370:20: warning: 'CommandLine::tmsisHelp' defined but not used [-Wunused-variable]
static const char tmsisHelp = "[-l | clear | dump [-l] | -delete -tmsi | -delete -imsi | -query ] --\n"
^~~~~~~~~
CLI.cpp:231:27: warning: 'std::map<std::__cxx11::basic_string, std::__cxx11::basic_string > CommandLine::cliParse(int&, char
&, std::ostream&, const char
)' defined but not used [-Wunused-function]
static map<string,string> cliParse(int &argc, char **&argv, ostream &os, const char *optstring)
^~~~~~~~
make[2]: *** [Makefile:500: CLI.lo] Error 1
make[2]: Leaving directory '/home/mike/folder/progs/openbts_3g_v1/OpenBTS-UMTS/CLI'
make[1]: *** [Makefile:549: all-recursive] Error 1
make[1]: Leaving directory '/home/mike/folder/progs/openbts_3g_v1/OpenBTS-UMTS'
make: *** [Makefile:480: all] Error 2

@mike01 mike01 changed the title Compilation failes with error: 'constexpr' needed for in-class initialization of static data member Compilation fails with error: 'constexpr' needed for in-class initialization of static data member Sep 25, 2018
@vandong123
Copy link

../UMTS/UMTSRadioModem.h:181:16: error: ‘constexpr’ does not name a type
i got same error. does anyone fix that?

@alejandro-amo
Copy link

Same here. Researching possible solutions

@alejandro-amo
Copy link

found it. #25 and #26 are caused for more or less the same thing.
see #26 (comment)

@bbaranoff
Copy link

If not working just with gcc-5 g++-5 try to add
make CXXFLAGS=-std=c++11

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

4 participants