Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: ncsupanda on February 28, 2014, 04:05:24 PM



Title: Compiling using MinGW
Post by: ncsupanda on February 28, 2014, 04:05:24 PM
I know I shouldn't be using MinGW for a project like this, but I'm stuck.

My dependencies are in C:\Deps, and I have used:
  • boost_1_55_0
  • db-4.8.30.NC
  • miniupnpc
  • openssl-1.0.1e

In my makefile.mingw, I'm having problems with the db_cxx, ssl, and crypto Libraries:

Code:

DEPSDIR?=c:/Deps
BOOST_SUFFIX?=-mgw48-mt-s-1_55

INCLUDEPATHS= \
 -I"$(CURDIR)" \
 -I"c:/Deps/boost_1_55_0/boost_1_55_0/boost_1_55_0" \
 -I"c:/Deps/db-4.8.30.NC/build_windows" \
 -I"c:/Deps/openssl-1.0.1e/include"
 
LIBPATHS= \
 -L"$(CURDIR)/leveldb" \
 -L"c:/Deps/boost_1_55_0/boost_1_55_0/stage/lib" \
 -L"c:/Deps/db-4.8.30.NC/build_windows" \
 -L"c:/Deps/openssl-1.0.1e"

 
LIBS= \
 -l leveldb \
 -l memenv \
 -l boost_system$(BOOST_SUFFIX) \
 -l boost_filesystem$(BOOST_SUFFIX) \
 -l boost_program_options$(BOOST_SUFFIX) \
 -l boost_thread$(BOOST_SUFFIX) \
 -l boost_chrono$(BOOST_SUFFIX) \
 -l db_cxx \
 -l ssl \
 -l crypto

MSYS Outputs:

cannot find -ldb_cxx
cannot find -lssl
cannot find -lcrypto

Any help? I'm not sure what I can do to fix this error.


Title: Re: Compiling using MinGW
Post by: mecoin on February 28, 2014, 05:55:00 PM
I know I shouldn't be using MinGW for a project like this, but I'm stuck.

My dependencies are in C:\Deps, and I have used:
  • boost_1_55_0
  • db-4.8.30.NC
  • miniupnpc
  • openssl-1.0.1e

In my makefile.mingw, I'm having problems with the db_cxx, ssl, and crypto Libraries:

Code:

DEPSDIR?=c:/Deps
BOOST_SUFFIX?=-mgw48-mt-s-1_55

INCLUDEPATHS= \
 -I"$(CURDIR)" \
 -I"c:/Deps/boost_1_55_0/boost_1_55_0/boost_1_55_0" \
 -I"c:/Deps/db-4.8.30.NC/build_windows" \
 -I"c:/Deps/openssl-1.0.1e/include"
 
LIBPATHS= \
 -L"$(CURDIR)/leveldb" \
 -L"c:/Deps/boost_1_55_0/boost_1_55_0/stage/lib" \
 -L"c:/Deps/db-4.8.30.NC/build_windows" \
 -L"c:/Deps/openssl-1.0.1e"

 
LIBS= \
 -l leveldb \
 -l memenv \
 -l boost_system$(BOOST_SUFFIX) \
 -l boost_filesystem$(BOOST_SUFFIX) \
 -l boost_program_options$(BOOST_SUFFIX) \
 -l boost_thread$(BOOST_SUFFIX) \
 -l boost_chrono$(BOOST_SUFFIX) \
 -l db_cxx \
 -l ssl \
 -l crypto

MSYS Outputs:

cannot find -ldb_cxx
cannot find -lssl
cannot find -lcrypto

Any help? I'm not sure what I can do to fix this error.

did you check your paths ???
studying this helped me before:
http://www.mingw.org/wiki/HOWTO_Specify_the_Location_of_Libraries_for_use_with_MinGW


Title: Re: Compiling using MinGW
Post by: ScripterRon on February 28, 2014, 07:17:00 PM
I have successfully built bitcoind.exe and bitcoin-cli.exe from the latest master using MinGW.  I also ran into these problems and solved them with a hammer by simply copying files to places that are checked by default  :D

I copied the BDB include files to /mingw/include/bdbd4.8 and the BDB library files to /mingw/lib

I copied the SSL library files to /mingw/lib

Boost is handled by specifying BOOST_ROOT=path-to-boost-install as part of the configure command.  For example:

    BOOST_ROOT=~/boost_1_55_0 ./configure --enable-tests=no

Note that /mingw is an msys mount point, so the files actually go to C:\MinGW\include and C:\MinGW\lib if you are using Windows commands to move things around.


Title: Re: Compiling using MinGW
Post by: ncsupanda on February 28, 2014, 07:59:07 PM
I have successfully built bitcoind.exe and bitcoin-cli.exe from the latest master using MinGW.  I also ran into these problems and solved them with a hammer by simply copying files to places that are checked by default  :D

I copied the BDB include files to /mingw/include/bdbd4.8 and the BDB library files to /mingw/lib

I copied the SSL library files to /mingw/lib

Boost is handled by specifying BOOST_ROOT=path-to-boost-install as part of the configure command.  For example:

    BOOST_ROOT=~/boost_1_55_0 ./configure --enable-tests=no

Note that /mingw is an msys mount point, so the files actually go to C:\MinGW\include and C:\MinGW\lib if you are using Windows commands to move things around.


Going to try this. I'll let you know how it goes.


Title: Re: Compiling using MinGW
Post by: ncsupanda on February 28, 2014, 09:27:37 PM
I have successfully built bitcoind.exe and bitcoin-cli.exe from the latest master using MinGW.  I also ran into these problems and solved them with a hammer by simply copying files to places that are checked by default  :D

I copied the BDB include files to /mingw/include/bdbd4.8 and the BDB library files to /mingw/lib

I copied the SSL library files to /mingw/lib

Boost is handled by specifying BOOST_ROOT=path-to-boost-install as part of the configure command.  For example:

    BOOST_ROOT=~/boost_1_55_0 ./configure --enable-tests=no

Note that /mingw is an msys mount point, so the files actually go to C:\MinGW\include and C:\MinGW\lib if you are using Windows commands to move things around.


Going to try this. I'll let you know how it goes.

Same exact issue. Manually moving the files did not fix the errors. It's only with those specific directories (db, ssl) that I'm getting the errors. The other directories are found, and are kept in the same location. So I'm just confused.


Title: Re: Compiling using MinGW
Post by: ScripterRon on February 28, 2014, 10:32:31 PM
I'm building 0.9.  From your description, it looks like you are building 0.8.x since there is no makefile.mingw in 0.9.  I've never tried to build 0.8.x, so I can't help you there.

The only problem I had with 0.9 was an empty else clause that caused configure to fail.  This was fixed and bitcoind now builds without any editing of the supplied scripts.  You might consider building the latest from github (they are preparing for RC2 now).

Here is the bitcoin build steps that I use after building the dependencies (openssl-1.0.1e, db-4.8.30.NC and boost-1_55_0):

    cd bitcoin/0.9.0
    ./autogen.sh
    BOOST_ROOT=~/boost_1_55_0 CPPFLAGS="-D_WIN32_WINNT=0x0602 -DWINVER=0x0602" ./configure --enable-tests=no
    make
    strip bitcoind.exe
    strip bitcoin-cli.exe

I've been told that I shouldn't need to specify CPPFLAGS, but the build fails if I don't (at least on my Windows 7 system).

Note that I build just the daemon and not the GUI (bitcoin-qt).  Getting Qt to build on MinGW is an adventure in its own right.  I know people have done it but it just isn't worth the effort since I have my own node server and my own wallet.  I run bitcoind locally just so I can check its debug.log to see if it is unhappy with anything that I'm doing.


Title: Re: Compiling using MinGW
Post by: ScripterRon on February 28, 2014, 10:58:38 PM
By the way, you might try copying the db headers to /mingw/include as well.  I have them in both places.  I seem to recall having a problem with 'configure' and 'make' looking in different places, but it has been awhile now since I built bdb4.8 and I was trying all kinds of things to get it to work.