<p>You did not compile LevelDB. In your altcoin's source code, you should see a folder for leveldb. <code>cd</code> into that directory and build leveldb. There should be instructions for that in the leveldb folder.</p>

CC BY-SA 3.0
2017-10-20T03:32:42.297Z
Thank you for your advice. but I did compile LevelDB because i have LevelDB source in altcoin`s source folder
southouse
CC BY-SA 3.0
2017-10-20T03:36:00.733Z
Just because the source is there does not mean that it was compiled. The makefile that you built with does not necessarily include instructions to build that code. IIRC, many altcoins are like this in that the leveldb stuff must be built separately as it uses separate makefiles.
Ava Chow
CC BY-SA 3.0
2017-10-20T03:41:37.127Z
if so recompiling to LevelDB?
southouse
CC BY-SA 3.0
2017-10-20T03:43:34.267Z
Your last comment does not make sense. You need to build leveldb and put the resulting files (should be `.a` files in the right place so that they can be linked when you build the rest of your altcoin source code.
Ava Chow
CC BY-SA 3.0
2017-10-20T03:46:06.083Z
How do I know that compilation was not successful?
southouse
CC BY-SA 3.0
2017-10-20T03:46:48.487Z
I confirmed that there is an leveldb object file.
southouse
CC BY-SA 3.0
2017-10-20T03:47:32.253Z
Then it is not in a place where the linker is able to find it. Can you update your question with a link to the source code that you are building?
Ava Chow
CC BY-SA 3.0
2017-10-20T03:52:34.117Z
It is the result after the qmake command.

It is part of the Makefile.Release file
southouse
CC BY-SA 3.0
2017-10-20T03:54:10.660Z
LIBS        =        -L"c:\Qt\4.8.6\lib" build\bitcoin-qt_res.o -lshlwapi -lpthread -lssl -lcrypto -ldb_cxx -lws2_32 -lole32 -loleaut32 -luuid -lgdi32 -lboost_system-mgw63-mt-1_55 -lboost_filesystem-mgw63-mt-1_55 -lboost_program_options-mgw63-mt-1_55 -lboost_thread-mgw63-mt-1_55
southouse
CC BY-SA 3.0
2017-10-20T03:54:26.823Z
-LC:/deps/miniupnpc -lminiupnpc -liphlpapi  C:/toscoin-src/src/leveldb/libleveldb.a C:/toscoin-src/src/leveldb/libmemenv.a -lshlwapi -LC:/deps/boost_1_55_0/stage/lib -Lc:/deps/db-5.3.28.NC/build_unix -Lc:/deps/openssl-1.0.2l -LC:/deps/qrencode-3.4.4/.libs -lssl -lcrypto -ldb_cxx -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32 -lboost_system-mgw63-mt-1_55 -lboost_filesystem-mgw63-mt-1_55 -lboost_program_options-mgw63-mt-1_55 -lboost_thread-mgw63-mt-1_55
southouse
CC BY-SA 3.0
2017-10-20T03:54:29.063Z
-lboost_chrono-mgw63-mt-1_55 -lQtGui4 -lQtNetwork4 -lQtCore4 -lpthread C:/toscoin-src/src/leveldb/libleveldb.a C:/toscoin-src/src/leveldb/libmemenv.a
southouse
CC BY-SA 3.0
2017-10-20T03:58:01.970Z
Please post your above comments as an edit to your original post, it is too hard to read here.
Ava Chow
CC BY-SA 3.0
2017-10-20T04:50:20.583Z
Sorry, show content
southouse
CC BY-SA 3.0
2017-10-20T05:01:54.397Z
Do you see the files `libleveldb.a` and `libmemenv.a` in `C:/toscoin-src/src/leveldb/`?
Ava Chow
CC BY-SA 3.0
2017-10-20T05:07:47.823Z
The file located in C:\toscoin-src\src\leveldb directory
southouse
CC BY-SA 3.0
2017-10-23T07:47:56.423Z
I would appreciate it if you could tell me how.
southouse
CC BY-SA 3.0
2017-10-20T03:30:29.753Z
2017-10-20T03:30:29.753Z
Ava Chow
<p>OS : Windows 10</p>

<p>Installed Dependencies:</p>

<ul>
<li>-qt4.8.6</li>
<li>gcc 6.3.0</li>
<li>boost 1_55_0</li>
<li>berkeleyDB 4.8.30NC</li>
<li>openssl 1.0.2l</li>
</ul>

<p>I tried compiling with the following commands:</p>

<pre><code>qmake "USE_UPNP=1" coin-pt.pro
mingw32-make -f Makefile.Release
</code></pre>

<p>That resulted in this error:</p>

<pre><code>./build\leveldb.o:leveldb.cpp:(.text+0x664): undefined reference to leveldb::DB::Open(leveldb::Options const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, leveldb::DB**)'
./build\leveldb.o:leveldb.cpp:(.text+0x72b): undefined reference toleveldb::DestroyDB(std::__cxx11::basic_string, std::allocator &gt; const&amp;, leveldb::Options const&amp;)' ./build\leveldb.o:leveldb.cpp:(.text+0x826): undefined reference to leveldb::Status::ToString[abi:cxx11]() const'
./build\leveldb.o:leveldb.cpp:(.text+0x9b3): undefined reference toleveldb::Status::ToStringabi:cxx11 const' ./build\txdb.o:txdb.cpp:(.text+0x39b): undefined reference to leveldb::Status::ToString[abi:cxx11]() const'
./build\txdb.o:txdb.cpp:(.text+0xcc5): undefined reference toleveldb::Status::ToStringabi:cxx11 const' ./build\txdb.o:txdb.cpp:(.text+0xeb4): undefined reference to leveldb::Status::ToString[abi:cxx11]() const'
./build\txdb.o:txdb.cpp:(.text+0x1520): more undefined references toleveldb::Status::ToStringabi:cxx11 const' follow collect2.exe: error: ld returned 1 exit status Makefile.Release:287: recipe for target 'release\Coin-qt.exe' failed mingw32-make: *** [release\Coin-qt.exe] Error 1
</code></pre>

<p>How do I fix this problem?</p>

<hr>

<p>It is the result after the qmake command. It is part of the Makefile.Release file</p>

<pre><code>LIBS = -L"c:\Qt\4.8.6\lib" build\bitcoin-qt_res.o -lshlwapi -lpthread -lssl -lcrypto -ldb_cxx -lws2_32 -lole32 -loleaut32 -luuid -lgdi32 -lboost_system-mgw63-mt-1_55 -lboost_filesystem-mgw63-mt-1_55 -lboost_program_options-mgw63-mt-1_55 -lboost_thread-mgw63-mt-1_55 -LC:/deps/miniupnpc -lminiupnpc -liphlpapi  C:/toscoin-src/src/leveldb/libleveldb.a C:/toscoin-src/src/leveldb/libmemenv.a -lshlwapi -LC:/deps/boost_1_55_0/stage/lib -Lc:/deps/db-5.3.28.NC/build_unix -Lc:/deps/openssl-1.0.2l -LC:/deps/qrencode-3.4.4/.libs -lssl -lcrypto -ldb_cxx -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32 -lboost_system-mgw63-mt-1_55 -lboost_filesystem-mgw63-mt-1_55 -lboost_program_options-mgw63-mt-1_55 -lboost_thread-mgw63-mt-1_55 -lboost_chrono-mgw63-mt-1_55 -lQtGui4 -lQtNetwork4 -lQtCore4 -lpthread C:/toscoin-src/src/leveldb/libleveldb.a C:/toscoin-src/src/leveldb/libmemenv.a
</code></pre>

<development><altcoin><leveldb>
how to build altcoin in mingw?
southouse
# how to build altcoin in mingw?

(Asked by: username_0 on 2017-10-20)

OS : Windows 10
Installed Dependencies:

-qt4.8.6
gcc 6.3.0
boost 1_55_0
berkeleyDB 4.8.30NC
openssl 1.0.2l

I tried compiling with the following commands:
qmake "USE_UPNP=1" coin-pt.pro
mingw32-make -f Makefile.Release

That resulted in this error:
./build\leveldb.o:leveldb.cpp:(.text+0x664): undefined reference to leveldb::DB::Open(leveldb::Options const&, std::__cxx11::basic_string, std::allocator > const&, leveldb::DB**)'
./build\leveldb.o:leveldb.cpp:(.text+0x72b): undefined reference toleveldb::DestroyDB(std::__cxx11::basic_string, std::allocator > const&, leveldb::Options const&)' ./build\leveldb.o:leveldb.cpp:(.text+0x826): undefined reference to leveldb::Status::ToString[abi:cxx11]() const'
./build\leveldb.o:leveldb.cpp:(.text+0x9b3): undefined reference toleveldb::Status::ToStringabi:cxx11 const' ./build\txdb.o:txdb.cpp:(.text+0x39b): undefined reference to leveldb::Status::ToString[abi:cxx11]() const'
./build\txdb.o:txdb.cpp:(.text+0xcc5): undefined reference toleveldb::Status::ToStringabi:cxx11 const' ./build\txdb.o:txdb.cpp:(.text+0xeb4): undefined reference to leveldb::Status::ToString[abi:cxx11]() const'
./build\txdb.o:txdb.cpp:(.text+0x1520): more undefined references toleveldb::Status::ToStringabi:cxx11 const' follow collect2.exe: error: ld returned 1 exit status Makefile.Release:287: recipe for target 'release\Coin-qt.exe' failed mingw32-make: *** [release\Coin-qt.exe] Error 1

How do I fix this problem?

It is the result after the qmake command. It is part of the Makefile.Release file
LIBS = -L"c:\Qt\4.8.6\lib" build\bitcoin-qt_res.o -lshlwapi -lpthread -lssl -lcrypto -ldb_cxx -lws2_32 -lole32 -loleaut32 -luuid -lgdi32 -lboost_system-mgw63-mt-1_55 -lboost_filesystem-mgw63-mt-1_55 -lboost_program_options-mgw63-mt-1_55 -lboost_thread-mgw63-mt-1_55 -LC:/deps/miniupnpc -lminiupnpc -liphlpapi  C:/toscoin-src/src/leveldb/libleveldb.a C:/toscoin-src/src/leveldb/libmemenv.a -lshlwapi -LC:/deps/boost_1_55_0/stage/lib -Lc:/deps/db-5.3.28.NC/build_unix -Lc:/deps/openssl-1.0.2l -LC:/deps/qrencode-3.4.4/.libs -lssl -lcrypto -ldb_cxx -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32 -lboost_system-mgw63-mt-1_55 -lboost_filesystem-mgw63-mt-1_55 -lboost_program_options-mgw63-mt-1_55 -lboost_thread-mgw63-mt-1_55 -lboost_chrono-mgw63-mt-1_55 -lQtGui4 -lQtNetwork4 -lQtCore4 -lpthread C:/toscoin-src/src/leveldb/libleveldb.a C:/toscoin-src/src/leveldb/libmemenv.a

**Tags:** development, altcoin, leveldb


---

## 1 answers

### Answer by username_1 on 2017-10-20. Score: 0

You did not compile LevelDB. In your altcoin's source code, you should see a folder for leveldb. `cd` into that directory and build leveldb. There should be instructions for that in the leveldb folder.

> **Comments:**
> **username_0**: Thank you for your advice. but I did compile LevelDB because i have LevelDB source in altcoin`s source folder  
> **username_1**: Just because the source is there does not mean that it was compiled. The makefile that you built with does not necessarily include instructions to build that code. IIRC, many altcoins are like this in that the leveldb stuff must be built separately as it uses separate makefiles.  
> **username_0**: if so recompiling to LevelDB?  
> **username_1**: Your last comment does not make sense. You need to build leveldb and put the resulting files (should be `.a` files in the right place so that they can be linked when you build the rest of your altcoin source code.  
> **username_0**: How do I know that compilation was not successful?  
> **username_0**: I confirmed that there is an leveldb object file.  
> **username_1**: Then it is not in a place where the linker is able to find it. Can you update your question with a link to the source code that you are building?  
> **username_0**: It is the result after the qmake command.  It is part of the Makefile.Release file  
> **username_0**: LIBS        =        -L"c:\Qt\4.8.6\lib" build\bitcoin-qt_res.o -lshlwapi -lpthread -lssl -lcrypto -ldb_cxx -lws2_32 -lole32 -loleaut32 -luuid -lgdi32 -lboost_system-mgw63-mt-1_55 -lboost_filesystem-mgw63-mt-1_55 -lboost_program_options-mgw63-mt-1_55 -lboost_thread-mgw63-mt-1_55  
> **username_0**: -LC:/deps/miniupnpc -lminiupnpc -liphlpapi  C:/toscoin-src/src/leveldb/libleveldb.a C:/toscoin-src/src/leveldb/libmemenv.a -lshlwapi -LC:/deps/boost_1_55_0/stage/lib -Lc:/deps/db-5.3.28.NC/build_unix -Lc:/deps/openssl-1.0.2l -LC:/deps/qrencode-3.4.4/.libs -lssl -lcrypto -ldb_cxx -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32 -lboost_system-mgw63-mt-1_55 -lboost_filesystem-mgw63-mt-1_55 -lboost_program_options-mgw63-mt-1_55 -lboost_thread-mgw63-mt-1_55  
> **username_0**: -lboost_chrono-mgw63-mt-1_55 -lQtGui4 -lQtNetwork4 -lQtCore4 -lpthread C:/toscoin-src/src/leveldb/libleveldb.a C:/toscoin-src/src/leveldb/libmemenv.a  
> **username_1**: Please post your above comments as an edit to your original post, it is too hard to read here.  
> **username_0**: Sorry, show content  
> **username_1**: Do you see the files `libleveldb.a` and `libmemenv.a` in `C:/toscoin-src/src/leveldb/`?  
> **username_0**: The file located in C:\toscoin-src\src\leveldb directory  
> **username_0**: I would appreciate it if you could tell me how.  

---

