<p>So I found <a href="https://bitcointa.lk/threads/bitcoin-core-0-10-0-has-been-released.422213/page-5" rel="nofollow">this thread</a> that gave me the clue how to workaround this issue, basically insert the following at line 5 of <code>src/leveldb/helpers/memenv/memenv.h</code> and it compiles fine:</p>

<pre><code>#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
</code></pre>

CC BY-SA 3.0
2015-07-28T13:59:23.630Z
2015-07-28T13:59:23.630Z
Diego vDev
<p>I am trying to run a bitcoind instance (branch 0.9 from git repository) on CentOS 6.6 following <a href="https://gist.github.com/janx/10465121" rel="nofollow">this guide</a> but I get this error when building LevelDB:</p>

<pre><code>Building LevelDB ...
make[3]: Entering directory `/home/bitcoind/bitcoind/downloads/bitcoin/src/leveldb'
g++ -I. -I./include -fno-builtin-memcmp -pthread -DOS_LINUX -DLEVELDB_PLATFORM_POSIX -g -O2 -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter  -Wstack-protector -fstack-protector-all -fPIE -fvisibility=hidden -I/home/bitcoind/bitcoind/deps/include -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -c helpers/memenv/memenv.cc -o helpers/memenv/memenv.o
helpers/memenv/memenv.cc: In member function ‘leveldb::Status leveldb::&lt;unnamed&gt;::FileState::Read(uint64_t, size_t, leveldb::Slice*, char*) const’:
helpers/memenv/memenv.cc:65: error: ‘SIZE_MAX’ was not declared in this scope
make[3]: *** [helpers/memenv/memenv.o] Error 1
make[3]: Leaving directory `/home/bitcoind/bitcoind/downloads/bitcoin/src/leveldb'
make[2]: *** [leveldb/libmemenv.a] Error 2
make[2]: Leaving directory `/home/bitcoind/bitcoind/downloads/bitcoin/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bitcoind/bitcoind/downloads/bitcoin/src'
make: *** [all-recursive] Error 1
</code></pre>

<p>gcc version: <code>gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)</code></p>

<p><a href="http://pastebin.com/XZtFk6at" rel="nofollow">Here is the a pastebin</a> with the end of the compiling output.</p>

<p>Anyone have some idea on how to workaround it?</p>

<bitcoind><leveldb>
bitcoin compile error on CentOS 6.6: ‘SIZE_MAX’ was not declared in this scope
Diego vDev
# bitcoin compile error on CentOS 6.6: ‘SIZE_MAX’ was not declared in this scope

(Asked by: username_0 on 2015-07-27)

I am trying to run a bitcoind instance (branch 0.9 from git repository) on CentOS 6.6 following [this guide](https://gist.github.com/janx/10465121) but I get this error when building LevelDB:

```
Building LevelDB ...
make[3]: Entering directory `/home/bitcoind/bitcoind/downloads/bitcoin/src/leveldb'
g++ -I. -I./include -fno-builtin-memcmp -pthread -DOS_LINUX -DLEVELDB_PLATFORM_POSIX -g -O2 -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter  -Wstack-protector -fstack-protector-all -fPIE -fvisibility=hidden -I/home/bitcoind/bitcoind/deps/include -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -c helpers/memenv/memenv.cc -o helpers/memenv/memenv.o
helpers/memenv/memenv.cc: In member function ‘leveldb::Status leveldb::<unnamed>::FileState::Read(uint64_t, size_t, leveldb::Slice*, char*) const’:
helpers/memenv/memenv.cc:65: error: ‘SIZE_MAX’ was not declared in this scope
make[3]: *** [helpers/memenv/memenv.o] Error 1
make[3]: Leaving directory `/home/bitcoind/bitcoind/downloads/bitcoin/src/leveldb'
make[2]: *** [leveldb/libmemenv.a] Error 2
make[2]: Leaving directory `/home/bitcoind/bitcoind/downloads/bitcoin/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bitcoind/bitcoind/downloads/bitcoin/src'
make: *** [all-recursive] Error 1

```

gcc version: `gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)`

[Here is the a pastebin](http://pastebin.com/XZtFk6at) with the end of the compiling output.

Anyone have some idea on how to workaround it?

**Tags:** bitcoind, leveldb


---

## 1 answers

### Answer by username_0 on 2015-07-28. Score: 1 | Accepted answer

So I found [this thread](https://bitcointa.lk/threads/bitcoin-core-0-10-0-has-been-released.422213/page-5) that gave me the clue how to workaround this issue, basically insert the following at line 5 of `src/leveldb/helpers/memenv/memenv.h` and it compiles fine:

```
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif

```


---

