Title: Compiling with Visual Studio Post by: storr on June 30, 2011, 12:02:17 PM Hi all!
I am trying to build bitcoin with VC2010 Express. It compiles but doesn't work. I think the problem is in inconsistency between compilation/linking keys of libraries and bitcoin. As far as I understand, there are many guys here who builds bitcoin with some version of Visual Studio. Could you help me, please? I want to build buitcoin with any Visual Studio version. Could you share your project file and tell how you build libraries? Or maybe there is a ready link for this? I build libraries in this way: cd wxWidgets-2.9.1\build\msw nmake -f makefile.vc cd openssl-1.0.0d perl Configure VC-WIN32 no-asm ms\do_ms nmake -f ms\ntdll.mak db-4.7.25.NC\build_windows\Berkeley_DB.dsw cd boost-1.43.0 bootstrap (makes bjam) bjam toolset=msvc-10.0 threading=multi --build-type=complete stage Get upnpc-exe-win32-20110215.zip and unzip it to \upnpc-exe-win32-20110215 Get miniupnpc-1.5.20110215.tar.gz and copy *.h to \upnpc-exe-win32-20110215\miniupnpc Thanks! Title: Re: Compiling with Visual Studio Post by: EricJ2190 on June 30, 2011, 07:24:06 PM If you haven't done so, you need to edit your makefile to make sure it's INCLUDEPATHS and LIBPATHS point to the proper directory of your libraries.
If that isn't it, can you post the error? Title: Re: Compiling with Visual Studio Post by: storr on June 30, 2011, 09:04:59 PM If you haven't done so, you need to edit your makefile to make sure it's INCLUDEPATHS and LIBPATHS point to the proper directory of your libraries. If that isn't it, can you post the error? After launch Bitcoin.exe throws an Access violation exception in function _initterm_e. It even not enters in WinMain function. Also Dependency Walker sais "Error processing the module's imports table". This is my parameters of compilation: cl /MDd /c /nologo /EHsc /GR /Zm300 /Zi /Os /D_DEBUG /DWIN32 /D__WXMSW__ /D_WINDOWS /DNOPCH /DUSE_UPNP /I"../../boost_1_43_0" /I"../../db-4.7.25.NC/build_windows" /I"../../openssl-1.0.0d/include" /I"../../wxwidgets-2.9.1/lib/vc_lib/mswud" /I"../../wxwidgets-2.9.1/include" /I"../../upnpc-exe-win32-20110215" /DGUI /Foobj\util.obj util.cpp util.cpp This is my parameters of linking: link /nologo /SUBSYSTEM:WINDOWS /DEBUG /OUT:bitcoin.exe /LIBPATH:"../../boost_1_43_0/stage/lib" /LIBPATH:"../../db-4.7.25.NC/build_windows/Debug" /LIBPATH:"../../openssl-1.0.0d/out32dll" /LIBPATH:"../../wxwidgets-2.9.1/lib/vc_lib" obj\util.obj obj\script.obj obj\db.obj obj\net.obj obj\irc.obj obj\main.obj obj\rpc.obj obj\init.obj cryptopp\obj\sha.obj cryptopp\obj\cpu.obj obj\ui.obj obj\uibase.obj obj\ui.res wxmsw29ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib libboost_system-vc100-mt-gd.lib libboost_filesystem-vc100-mt-gd.lib libboost_program_options-vc100-mt-gd.lib libboost_thread-vc100-mt-gd.lib libdb47d.lib libeay32.lib "../../upnpc-exe-win32-20110215/miniupnpc.lib" kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib shlwapi.lib Could you show your parameters of compilation\linking? Title: Re: Compiling with Visual Studio Post by: EricJ2190 on July 01, 2011, 12:51:45 AM It has been a while since I last built Bitcoin on MSVC. I tried to do it today so I could explain how I did it, and it seems the VC makefile is broken. I am going work on trying to fix it up, and I'll let you know when I get it to compile.
Title: Re: Compiling with Visual Studio Post by: EricJ2190 on July 01, 2011, 03:09:39 AM I got it to build and run using the following modified version of makefile.vc:
Code: # Copyright (c) 2009-2010 Satoshi Nakamoto If you use this, you'll want to set INCLUDEPATHS and LIBPATHS to your own library locations. The changes I made are:
Also, for wxWidgets, make sure you either edit config.vc to make a release build before building, or modify this makefile to use the default debug build. Edit: Spoke too soon. After running for a few seconds, my Bitcoin build is being terminated by DEP. This applies to both bitcoin.exe and bitcoind.exe. It appears the issue was with MiniUPnP. I have been completely unsuccessful of making my own build of miniupnpc.lib using VC, so I built it without UPnP entirely. In order to build Bitcoin without USE_UPNP defined, I had to make a small modification to net.cpp by added the following lines after the MapPort function: Code: #else More Edit: D'oh! I forgot to copy the MiniUPnP DLL to the same directory as bitcoin.exe when using the prebuilt MiniUPnP. That solves the DEP issue. Title: Re: Compiling with Visual Studio Post by: storr on July 01, 2011, 10:35:46 AM Thank you, EricJ2190.
I tried to build with your makefile and achieved success. Title: Re: Compiling with Visual Studio Post by: rlh on December 13, 2013, 03:51:16 PM A lot has changed since 2011. Has anyone updated this instruction set for the more recent version of Bitcoin?
Title: Re: Compiling with Visual Studio Post by: grue on December 13, 2013, 03:52:59 PM A lot has changed since 2011. Has anyone updated this instruction set for the more recent version of Bitcoin? https://bitcoinqtmsvc2012.codeplex.com/Title: Re: Compiling with Visual Studio Post by: rlh on December 13, 2013, 03:58:44 PM A lot has changed since 2011. Has anyone updated this instruction set for the more recent version of Bitcoin? https://bitcoinqtmsvc2012.codeplex.com/ |