how to build altcoin in mingw?

-1

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<char, std::char_traits<char>, std::allocator<char> > 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

Andrew Nam

Posted 2017-10-20T03:23:04.723

Reputation: 1

Answers

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.

Andrew Chow

Posted 2017-10-20T03:23:04.723

Reputation: 40 910

Thank you for your advice. but I did compile LevelDB because i have LevelDB source in altcoin`s source folderAndrew Nam 2017-10-20T03:32:42.297

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.Andrew Chow 2017-10-20T03:36:00.733

if so recompiling to LevelDB?Andrew Nam 2017-10-20T03:41:37.127

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.Andrew Chow 2017-10-20T03:43:34.267

How do I know that compilation was not successful?Andrew Nam 2017-10-20T03:46:06.083

I confirmed that there is an leveldb object file.Andrew Nam 2017-10-20T03:46:48.487

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?Andrew Chow 2017-10-20T03:47:32.253

It is the result after the qmake command.

It is part of the Makefile.Release file – Andrew Nam 2017-10-20T03:52:34.117

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_55Andrew Nam 2017-10-20T03:54:10.660

-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_55Andrew Nam 2017-10-20T03:54:26.823

-lboost_chrono-mgw63-mt-1_55 -lQtGui4 -lQtNetwork4 -lQtCore4 -lpthread C:/toscoin-src/src/leveldb/libleveldb.a C:/toscoin-src/src/leveldb/libmemenv.aAndrew Nam 2017-10-20T03:54:29.063

Please post your above comments as an edit to your original post, it is too hard to read here.Andrew Chow 2017-10-20T03:58:01.970

Sorry, show contentAndrew Nam 2017-10-20T04:50:20.583

Do you see the files libleveldb.a and libmemenv.a in C:/toscoin-src/src/leveldb/?Andrew Chow 2017-10-20T05:01:54.397

The file located in C:\toscoin-src\src\leveldb directoryAndrew Nam 2017-10-20T05:07:47.823

I would appreciate it if you could tell me how.Andrew Nam 2017-10-23T07:47:56.423