unitusdev / unitus

Source for Unitus - a merged mined, multi-algorithm crypto-currency.
https://unitus.online
MIT License
173 stars 64 forks source link

How to fix problems on building unitus(0.14.2) windows version. #4

Closed mizilmc closed 6 years ago

mizilmc commented 6 years ago

Unitus source.(0.14.2) https://github.com/unitusdev/unitus/tree/master

Referenced bitcoin source.(0.16) https://github.com/bitcoin/bitcoin/tree/master

Build platform and environment. Host:Windows8 Pro 64bit, VMware12, ubuntu 16.04 64bit. Build target platform - x86_64-w64-mingw32

I tried to build a Windows version as described in the guide.(https://github.com/unitusdev/unitus/blob/master/doc/build-windows.md) However, I could not complete the build smoothly due to some problems. Problems

steps to fix

1. build depends There is no Makefile in the dependss folder of unitus. There are also no files to automatically create Makefiles. Therefore, the make command can not be executed. (make: *** No targets specified and no makefile found. Stop.) Check out Makefile in bitcoin's depnds folder. I think this file is created manually and uses the files in the depends folder. Copy the Makefile from bitcoin/tree/master/depends to unitus. You can start building the depends. However, there is some problems in the build of zeromq and qt.

You can finish the depends build successfully. Try building according to the windows version build guide of unitus.

2. mman library problem When building unitus you will encounter the following error. checking for main in -lmman... no configure: error: lib missing Unitus's yecrypt uses mman, but there is no point in solving mman for building windows versions. Download the mman source from the url below and build it. (https://github.com/witwall/mman-win32) You can build in various ways. For example, you can build with vs 2015. Rename the resulting mman.lib file to libmman.a. Open the mman.h file with an editor and modify it as shown below. original:

#if defined(MMAN_LIBRARY)
#define MMANSHARED_EXPORT __declspec(dllexport)
#else
#define MMANSHARED_EXPORT __declspec(dllimport)
#endif

to:

//#if defined(MMAN_LIBRARY)
//#define MMANSHARED_EXPORT __declspec(dllexport)
//#else
//#define MMANSHARED_EXPORT __declspec(dllimport)
//#endif

#define MMANSHARED_EXPORT

Copy mman.h to depends/x86_64-w64-mingw32/include/sys/ folder.(create sys folder) Copy libmman.a to depends/x86_64-w64-mingw32/lib/ folder. You can configure successfully.

3. build unitus library error Unitus build output 4 binaries.

- unitus-cli unitus-tx (default=yes)
- libraries (default=yes)
- unitusd daemon (default=yes)
- bitcoin-qt GUI (default=auto, qt5 tried first)

Here is the error below when building libs.

primitives/.libs/libbitcoinconsensus_la-pureheader.o:pureheader.cpp:(.text+0x3bb): undefined reference to `SHA256'
collect2: error: ld returned 1 exit status

I think this is a problem with the ssl library link setup. However, I only needed to build the qt gui binary and used configure with --with-libs = no. CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/ --with-libs=no 4. Check unitus build result After you run make to complete the build, you will find four exe files in the unitus folder.

unitus-cli.exe
unitusd.exe
unitus-qt.exe
unitus-tx.exe

good luck!

nzsquirrell commented 6 years ago

You'll find most if not all of these issues have been taken care of in the most recent commits.