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

Error: ‘SIZE_MAX’ has not been declared in this scope #562

Closed
wjnodejs opened this issue Mar 13, 2018 · 3 comments
Closed

Error: ‘SIZE_MAX’ has not been declared in this scope #562

wjnodejs opened this issue Mar 13, 2018 · 3 comments
Assignees

Comments

@wjnodejs
Copy link

i try to compile with debug . i replace #OPT ?= -O2 -DNDEBUG with OPT ?= -g2 in MakeFile

ar: creating out-static/libleveldb.a
g++ -I. -I./include -fno-builtin-memcmp -pthread -DOS_LINUX -DLEVELDB_PLATFORM_POSIX -g2 -c helpers/memenv/memenv.cc -o out-static/helpers/memenv/memenv.o
helpers/memenv/memenv.cc: In member function ‘leveldb::Status leveldb::::FileState::Read(uint64_t, size_t, leveldb::Slice*, char*) const’:
helpers/memenv/memenv.cc:65: 错误:‘SIZE_MAX’在此作用域中尚未声明
make: *** [out-static/helpers/memenv/memenv.o] 错误 1

@wjnodejs
Copy link
Author

have included /usr/include/stdint.h in leveldb/env.h. moreover,i try to add #include <stdint.h>; /#include ;using namespace std; into helpers/memenv/memenv.cc, but it's not use.

@pwnall pwnall self-assigned this Mar 18, 2018
@pwnall
Copy link
Member

pwnall commented Mar 18, 2018

Hmm... memenv.h should include <stdint.h>. Sorry about that.

That being said... you said you've already tried adding #include <stdint.h>. I'm not sure what else it could be. The master branch generally passes Travis, meaning it should compile with reasonably new gcc and clang on Linux and Mac.

We've very recently switched to CMake. Give that a try and see if it works for you?

@pwnall pwnall changed the title 错误:‘SIZE_MAX’在此作用域中尚未声明 Error: ‘SIZE_MAX’ has not been declared in this scope Mar 18, 2018
@wjnodejs
Copy link
Author

thanks for your answer.
now ,it works ok after i delete the line at helpers/memenv/memenv.cc:65,i have a suspicion that my gcc is older.

@pwnall pwnall closed this as completed in 50fbc87 Mar 21, 2018
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