<p>Check if your <code>libleveldb.a</code> compiled all necessary files correctly. Could you run the following commands please and post the output back?</p>

<p><code>ar tv libmemenv.a</code> and <code>ar tv libleveldb.a</code>. If the output is something similar to</p>

<pre><code>rw-rw-rw- 0/0 432255 Apr 15 16:56 2014 memenv.o
rw-rw-rw- 0/0  21322 Apr 15 16:56 2014 port_win.o
</code></pre>

<p>then the problem could be that your Windows <code>find.exe</code> is overruling your MSYS <code>file.exe</code>. They both work very differently and are not interchangeable. The makefile of LevelDB uses the Unix style <code>find.exe</code>. You can fix this by explicitly putting your MSYS <code>find.exe</code> directory before the Windows <code>find.exe</code> directory (which should be something like <code>C:\Window\System32\find.exe</code>).</p>

<p>This was a very hard problem to track down and you can see my progress (and that of Ron, who kindly helped me a lot, thanks Ron!) on <a href="https://bitcointalk.org/index.php?topic=149479.540" rel="nofollow">the 'official' building Bitcoin thread on bitcointalk.org</a>. Starting at page 28 and continuing down until you don't see my name anymore (I'm called Jori there too, it's my real name).</p>

CC BY-SA 3.0
2014-06-22T17:14:04.127Z
2014-06-22T17:14:04.127Z
Jori
<p>that mean leveldb not compiled properly, on cygwin I use </p>

<pre><code>make -f makefile.unix clean
TARGET_OS="Linux"; make -f makefile.unix
</code></pre>

<p>with mingw <code>TARGET_OS</code> maybe <code>Linux</code> or <code>NATIVE_WINDOWS</code>
also try change permission <code>leveldb/build_detect_platform</code> to make it as executable</p>

CC BY-SA 3.0
2018-03-27T08:39:00.387Z
2018-03-27T08:39:00.387Z
ewwink
<p>After working my way through many errors compiling an alt-coin windows qt. </p>

<p>Everything compiles fine right until the final stage when the system is putting together the exe. </p>

<p>You can find the error below. leveldb is installed and libleveldb.a and libmemenv.a files are correctly in src/leveldb ... Any help resolving this issue would be appreciated. </p>

<pre><code>uuid -lgdi32 -lboost_system-mgw48-mt-1_54 -lboost_filesystem-mgw48-mt-1_54 -lboo
st_program_options-mgw48-mt-1_54 -lboost_thread-mgw48-mt-1_54 -lboost_chrono-mgw
48-mt-1_54 -lQtGui4 -lQtCore4
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x433): undefined reference to `l
eveldb::DB::Open(leveldb::Options const&amp;, std::string const&amp;, leveldb::DB**)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x73f): undefined reference to `l
eveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x866): undefined reference to `l
eveldb::WriteBatch::~WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x89f): undefined reference to `l
eveldb::WriteBatch::WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x921): undefined reference to `l
eveldb::WriteBatch::~WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x944): undefined reference to `l
eveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0xac4): undefined reference to `l
eveldb::WriteBatch::Iterate(leveldb::WriteBatch::Handler*) const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0xaf5): undefined reference to `l
eveldb::WriteBatch::Handler::~Handler()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0xb24): undefined reference to `l
eveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x14a9): undefined reference to `
leveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x176f): undefined reference to `
leveldb::WriteBatch::Put(leveldb::Slice const&amp;, leveldb::Slice const&amp;)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x18b2): undefined reference to `
leveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1a57): undefined reference to `
leveldb::Options::Options()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1ae0): undefined reference to `
leveldb::Options::Options()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1b35): undefined reference to `
leveldb::NewLRUCache(unsigned int)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1b44): undefined reference to `
leveldb::NewBloomFilterPolicy(int)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1b9c): undefined reference to `
leveldb::NewBloomFilterPolicy(int)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x2021): undefined reference to `
leveldb::WriteBatch::~WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x211d): undefined reference to `
leveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x35c3): undefined reference to `
leveldb::WriteBatch::Delete(leveldb::Slice const&amp;)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x6488): undefined reference to `
leveldb::WriteBatch::~WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x64b8): undefined reference to `
leveldb::WriteBatch::~WriteBatch()'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: ./build\tx
db-leveldb.o: bad reloc address 0x2 in section `.text$_ZN5boost16exception_detai
l10clone_baseD1Ev[__ZN5boost16exception_detail10clone_baseD1Ev]'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link
 failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
</code></pre>

CC BY-SA 3.0
2014-06-21T05:41:12.607Z
Are you linking to LevelDB?
David Schwartz
CC BY-SA 3.0
2014-06-22T16:59:24.693Z
@DavidSchwartz I believe the bitcoin makefile will automatically link the leveldb library. I had once a similar issue, that costed a lot of time to resolve. I will post it as answer.
Jori
<development><altcoin>
Got an issue compiling
user18314
# Got an issue compiling

(Asked by: username_0 on 2014-06-21)

After working my way through many errors compiling an alt-coin windows qt.

Everything compiles fine right until the final stage when the system is putting together the exe.

You can find the error below. leveldb is installed and libleveldb.a and libmemenv.a files are correctly in src/leveldb ... Any help resolving this issue would be appreciated.

```
uuid -lgdi32 -lboost_system-mgw48-mt-1_54 -lboost_filesystem-mgw48-mt-1_54 -lboo
st_program_options-mgw48-mt-1_54 -lboost_thread-mgw48-mt-1_54 -lboost_chrono-mgw
48-mt-1_54 -lQtGui4 -lQtCore4
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x433): undefined reference to `l
eveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x73f): undefined reference to `l
eveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x866): undefined reference to `l
eveldb::WriteBatch::~WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x89f): undefined reference to `l
eveldb::WriteBatch::WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x921): undefined reference to `l
eveldb::WriteBatch::~WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x944): undefined reference to `l
eveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0xac4): undefined reference to `l
eveldb::WriteBatch::Iterate(leveldb::WriteBatch::Handler*) const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0xaf5): undefined reference to `l
eveldb::WriteBatch::Handler::~Handler()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0xb24): undefined reference to `l
eveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x14a9): undefined reference to `
leveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x176f): undefined reference to `
leveldb::WriteBatch::Put(leveldb::Slice const&, leveldb::Slice const&)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x18b2): undefined reference to `
leveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1a57): undefined reference to `
leveldb::Options::Options()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1ae0): undefined reference to `
leveldb::Options::Options()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1b35): undefined reference to `
leveldb::NewLRUCache(unsigned int)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1b44): undefined reference to `
leveldb::NewBloomFilterPolicy(int)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1b9c): undefined reference to `
leveldb::NewBloomFilterPolicy(int)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x2021): undefined reference to `
leveldb::WriteBatch::~WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x211d): undefined reference to `
leveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x35c3): undefined reference to `
leveldb::WriteBatch::Delete(leveldb::Slice const&)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x6488): undefined reference to `
leveldb::WriteBatch::~WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x64b8): undefined reference to `
leveldb::WriteBatch::~WriteBatch()'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: ./build\tx
db-leveldb.o: bad reloc address 0x2 in section `.text$_ZN5boost16exception_detai
l10clone_baseD1Ev[__ZN5boost16exception_detail10clone_baseD1Ev]'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link
 failed: Invalid operation
collect2.exe: error: ld returned 1 exit status

```

**Tags:** development, altcoin

> **Comments:**
> **username_1**: Are you linking to LevelDB?  
> **username_2**: @username_1 I believe the bitcoin makefile will automatically link the leveldb library. I had once a similar issue, that costed a lot of time to resolve. I will post it as answer.  

---

## 2 answers

### Answer by username_2 on 2014-06-22. Score: 1

Check if your `libleveldb.a` compiled all necessary files correctly. Could you run the following commands please and post the output back?

`ar tv libmemenv.a` and `ar tv libleveldb.a`. If the output is something similar to

```
rw-rw-rw- 0/0 432255 Apr 15 16:56 2014 memenv.o
rw-rw-rw- 0/0  21322 Apr 15 16:56 2014 port_win.o

```

then the problem could be that your Windows `find.exe` is overruling your MSYS `file.exe`. They both work very differently and are not interchangeable. The makefile of LevelDB uses the Unix style `find.exe`. You can fix this by explicitly putting your MSYS `find.exe` directory before the Windows `find.exe` directory (which should be something like `C:\Window\System32\find.exe`).

This was a very hard problem to track down and you can see my progress (and that of Ron, who kindly helped me a lot, thanks Ron!) on [the 'official' building Bitcoin thread on bitcointalk.org](https://bitcointalk.org/index.php?topic=149479.540). Starting at page 28 and continuing down until you don't see my name anymore (I'm called username_2 there too, it's my real name).


---

### Answer by username_3 on 2018-03-27. Score: 0

that mean leveldb not compiled properly, on cygwin I use

```
make -f makefile.unix clean
TARGET_OS="Linux"; make -f makefile.unix

```

with mingw `TARGET_OS` maybe `Linux` or `NATIVE_WINDOWS`
also try change permission `leveldb/build_detect_platform` to make it as executable


---

