Bitcoin Forum
April 26, 2024, 09:52:40 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 »  All
  Print  
Author Topic: (Now At Github) Bitcoin 0.8.6 for *VS2013* (32 and 64 bit) and Qt5.2  (Read 10885 times)
Claire123 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
November 27, 2013, 04:23:52 PM
Last edit: March 11, 2014, 03:03:54 AM by Claire123
 #1

I forked a new project (again) from Bitcoin and committed the fixes for a port to Visual Studio 2013 on the 0.8.6 branch here:

https://github.com/ClaireDuSoleil/bitcoin/tree/0.8.6

This project builds the daemon, Qt app, and all the dependencies in 32 and 64 bit.  I re-worked the batch scripts that build the dependencies so please check out the readme:

https://github.com/ClaireDuSoleil/bitcoin/blob/0.8.6/MSVC/README.md

The projects at codeplex are still VS2012 and I don't currently have plans to continue updating these repositories:

Litecoin(0.8.6.2) :  https://coindusoleil.codeplex.com/

Bitcoin(0.8.6) : https://bitcoinqtmsvc2012.codeplex.com/

Please let me know if you notice any issues.  Thank you.

1714125160
Hero Member
*
Offline Offline

Posts: 1714125160

View Profile Personal Message (Offline)

Ignore
1714125160
Reply with quote  #2

1714125160
Report to moderator
According to NIST and ECRYPT II, the cryptographic algorithms used in Bitcoin are expected to be strong until at least 2030. (After that, it will not be too difficult to transition to different algorithms.)
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714125160
Hero Member
*
Offline Offline

Posts: 1714125160

View Profile Personal Message (Offline)

Ignore
1714125160
Reply with quote  #2

1714125160
Report to moderator
1714125160
Hero Member
*
Offline Offline

Posts: 1714125160

View Profile Personal Message (Offline)

Ignore
1714125160
Reply with quote  #2

1714125160
Report to moderator
1714125160
Hero Member
*
Offline Offline

Posts: 1714125160

View Profile Personal Message (Offline)

Ignore
1714125160
Reply with quote  #2

1714125160
Report to moderator
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
November 27, 2013, 06:33:27 PM
 #2

That's pretty impressive! I tried the same a few years ago with VC2010.

I'm not sure I see the point of creating a new codeplex project though, do you plan to contribute back the changes that were needed to github?

Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
Claire123 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
November 27, 2013, 07:25:03 PM
 #3

I'm not sure I see the point of creating a new codeplex project though, do you plan to contribute back the changes that were needed to github?

I just wanted a place to store the solution while I play with it and also let others access it, if they are interested.  I'm also used to TFS but not "git".  Anyway, if I make any changes that people actually care about, then I can add them to github.

I based the port on this source, not the latest from github:

http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.8.5/bitcoin-0.8.5-win32.zip/download

I just did a diff on main.h from the latest on github to the source that I started with and it's already way different. 

I'm having issues with InvalidChainFound and I'm stepping through it now to debug.
inkadnb
Member
**
Offline Offline

Activity: 126
Merit: 10


View Profile
November 27, 2013, 08:20:28 PM
 #4

Any chance you can fork off of the github project and make these changes?

That way we can do pull requests easily from github to the official project.

Or better yet, see if you can get these changes pushed up to the official project so that's all we need.

Thanks


dsattler
Legendary
*
Offline Offline

Activity: 924
Merit: 1000


View Profile
November 28, 2013, 07:27:25 AM
 #5

I really appreciate your work! I had just an idea for an improvement of bitcoin-qt, but as a VC++ developer I thought to save the trouble...

If I have the time I will look into it. Keep up the good work!

Bitcointalk member since 2013! Smiley
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
November 28, 2013, 08:13:19 AM
 #6

I just wanted a place to store the solution while I play with it and also let others access it, if they are interested.  I'm also used to TFS but not "git".  Anyway, if I make any changes that people actually care about, then I can add them to github.
Compatibility changes (if contained) would certainly be welcome!
Quote
That makes it more difficult to merge back changes, as they'd have to be forward ported to 0.9.

Our development process usually goes the other way around: develop on 0.9 and backport to 0.8.

Then again I expect most compatibility changes to carry forward pretty straightforwardly.

Quote
I just did a diff on main.h from the latest on github to the source that I started with and it's already way different.  
It's preferred to have a commit after every (logical) change instead of one big diff, to be able to review what was changed for which reason.

Quote
I'm having issues with InvalidChainFound and I'm stepping through it now to debug.
That's strange. Maybe an issue with the block database, in that case a -reindex will likely solve it. Unless there's a bug that somehow keeps corrupting it ofcourse.


Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
Claire123 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
December 02, 2013, 05:29:35 PM
 #7

I've updated the first post to emphasize that this project should only be used for educational purposes unless you really understand the code--and I don't, so I've switched over to testnet-in-a-box.

I have found a couple of issues, one of which caused me considerable grief.  The Bitcoin 0.8.5 source code relies on the ASSERT macro being active, even in release mode.  In wallet.cpp there is a line:

assert(reservekey.GetReservedKey(vchPubKey));

When you create new projects in MSVC, the release mode configuration, by default, has NDEBUG defined and, if NDEBUG is defined, ASSERT statements are NOPed.  This means that line of code from wallet.cpp gets skipped in a release mode compile and it contains a critical statement.  If that statement is NOPed, "change" from a BTC send transaction will be sent to a bogus address based on an empty string (1HT7xU2Ngenf7D4yocz2SAcnNLW7rK8d4E).   It was all working so well in debug mode so I switched over and whamo.  Well, it was quite a wake up call.

Live and learn.  When it first happened, I thought I had been hacked so I'm grateful that it was just a bug in the way I created the MSVC project.
rarkenin
Hero Member
*****
Offline Offline

Activity: 784
Merit: 500



View Profile
December 02, 2013, 10:25:38 PM
 #8

The Bitcoin 0.8.5 source code relies on the ASSERT macro being active, even in release mode.

This is a poor coding style in the original upstream, IMHO. Not that I'm a C++ developer by any means, I just hate these bugs in Java development.
Claire123 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
December 05, 2013, 08:43:00 PM
 #9

I've created a github project from a fork of bitcoin.  The original post has been updated with the details.
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
December 06, 2013, 12:30:46 PM
 #10

The Bitcoin 0.8.5 source code relies on the ASSERT macro being active, even in release mode.

This is a poor coding style in the original upstream, IMHO. Not that I'm a C++ developer by any means, I just hate these bugs in Java development.
Right, it was poor coding style, but recently this was fixed
https://github.com/bitcoin/bitcoin/commit/9b59e3bda8c137bff885db5b1f9150346e36e076

I've created a github project from a fork of bitcoin.  The original post has been updated with the details.
Great!


Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
TheBigYak
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile
December 11, 2013, 07:33:49 PM
 #11

Question here to Bitcoin Dev Team.. if this can be stabilized and shown not to affect the build capability on other OSes/build configs, would you consider merging into master at some point?  I'm pondering joining in here, but don't want to spend a lot of time on something that will ultimately always be a one-off.

greyman
Newbie
*
Offline Offline

Activity: 40
Merit: 0


View Profile WWW
December 29, 2013, 12:24:09 PM
 #12

Please can someone help me to compile the bitcoinqtmsvc2012? I am stuck in the finals steps. Following the instructions, I was able to successfuly compile boost, db, openssl, qt [at leasts it seems it is compiled], and bitcoind, but no luck with bitcoinQT. I am getting the following compiler errors:

3>  Moc'ing walletview.h...
3>  The system cannot find the path specified.
3>  Moc'ing walletstack.h...
3>  The system cannot find the path specified.
3>  Moc'ing walletmodel.h...
etc...


Do you have some hints how to fix this? I googled that it is related to QT, but didn't found the solution. I even installed QT5 plugin for VS2012, but I don't know how to configure it or if is necessary. Thanks for any help.
Claire123 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
December 29, 2013, 05:03:07 PM
 #13

It sounds like Qt did not get built properly or else moc.exe is not where the BitcoinQt project is expecting it to be.  Any .h file that contains a Q_OBJECT declaration must be processed by the Qt moc tool and moc.exe is something that needs to be built when you build Qt.  The BitcoinQt project expects it here:

"..\..\bitcoindeps\qt-everywhere-opensource-src-5.1.1\qtbase\bin\moc.exe" 

If this path does not exist, you will see that error.   Congratulations on your progress so far!  Smiley

The Qt plugin makes it easier to control or modify the location of the Qt but I didn't want to force people to install the plugin and the BitcoinQt project is not setup to use it which is why all paths are hardcoded in the project file.  It's ugly, I know.


I may not have internet access for a few days so future replies may be delayed--sorry about this.
greyman
Newbie
*
Offline Offline

Activity: 40
Merit: 0


View Profile WWW
December 29, 2013, 07:13:46 PM
 #14

Thank you Claire123,
FYI, I was able to compile the whole thing, I am already syncing with the network. ;-) The issue was, that I was not aware the solution folder must be next to the BitcoinDeps folder (in the same parent folder). After I moved it there it compiled without problems.
Claire123 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
January 14, 2014, 07:15:01 PM
 #15

I have received some private messages and emails asking me some questions so I thought I would post an update here.

Quote
1) As I understand it, it would be great if it could be a part of the main development project - do you think that would be realistic? It would require to make a few changes to the source code, for example some invocations of the IMPLEMENT_SERIALIZE doesn't compile with msvc, and also some other minor things. But the code should certainly be able to be modified to compile in both mingw/linux/msvc. Because as I understand it, you are now basically maintaining separate modified sources for this to work.

2) Would you consider to move all 3rd party libraries into your project? I tried it just today, and for example openssl and boost libraries can be comfortably added to the MSVC project through the NuGet Manager - no need to download, install, and compile them separately. Also the berkeley-db, it's just a bunch of headers and libs, it could be added directly to the project. Also the QT is doable, since we use it at my work, and we just integrated the sources to our source code tree and compile it together with our files. This way, people could just download the msvc solution and it would work out of the box without the need to install anything else.

3) Debugging: Please, did you manage to debug with Visual Studio? My problem is, that the blockchain is being downloaded (using the debug version of the bitcoinqt from your project), but at certain point, there are some nonstandard transactions there, which are handled by try/catch block - there are some invalid indexes to std::vector, which causes exceptions, and those are properly handled by the catch(...). But, every time this exception occurs, the exception dialog box is invoked in Visual Studio, and I must click "Continue"...but this happens hundreds of times, making the debugging practically impossible. I just didn't find any way how to permanently suppress those dialogs (so the breakpoint will not be invoked when handled exception occurs).

1. I really don't have specific plans.  I'm basically learning as I go here, although I'm trying to help out where I can.  I'm may start looking into resurrecting my github project and submitting the changes one or two files at a time, to see if they get accepted.  I'm not sure the Bitcoin team cares about MSVC but I may try a pull request to see what happens.  I need to spend some time learning github better, first, though.  My fear is that they won't want the solution and project files added to the official Bitcoin project.

2.  I'd rather not clutter up the solution any more than it already is.  I feel funny enough having put the QR code project in there now.  I use Qt and openssl in my work as well, but I think my team mates would have a fit if I tried to put them into the solution.  Currently, I build Qt/OpenSsl and give everyone the output in a zip file.  That seems to work the best, especially since we often have to switch back and forth between Qt versions.

3.  Yes, I have run the Bitcoin Qt app extensively in debug mode.  I had to make some code changes to avoid aborts due to the extra error checking in the MS version of the STL.  All the code changes I made for debug mode should be compatible with mingw.  Here is one example but there are several more:

https://bitcoinqtmsvc2012.codeplex.com/SourceControl/changeset/31241

old c coder
Sr. Member
****
Offline Offline

Activity: 260
Merit: 250



View Profile WWW
January 15, 2014, 07:45:32 AM
 #16

Hi Claire

I must answer number 2. in your messages, I hope you don't mind?

I have received some private messages and emails asking me some questions so I thought I would post an update here.

Quote
2) Would you consider to move all 3rd party libraries into your project?
That defeats the whole spirit of the libraries.  They should be separate static library builds to allow a simple rebuild of a newer library version, e.g. OpenSSL 1.0.1e in place of 1.0.1c.  Rebuild the MSVC static library project (minutes at the most) and simply relink the bitcoin project.  Keeping versions straight without library names would seem to quickly lead to insanity, don't you think?

Also, you are mixing their sources in your project.  Surely not ethical or proper.
Quote
Quote
I tried it just today, and for example openssl and boost libraries can be comfortably added to the MSVC project through the NuGet Manager - no need to download, install, and compile them separately.
You picked the two easy ones! They are almost trivial to build in MSVC++ given the instructional help, especially Boost.

You are adding another layer of complexity with NuGet to a simple process that doesn't need more complexity.  And it is (probably) only an easy VS2010 2012 install.  How about other Visual Studios, newer and older?
Quote
Quote
Also the berkeley-db, it's just a bunch of headers and libs,
Really!  I think Larry Ellison would disagree with you. Have you looked at
http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index-082944.html
have you looked at the version bitcoin uses?  Have you uncompressed and actually looked at what's there?  I don't see any, and I'll use your quote
Quote
it's just a bunch of headers and libs
BS, say I!  It is an interface for C/C++ and C sources for the actual database, and easy to work with VS projects, solutions and workspaces.  No libraries in sight.  And easy to build again.
Quote
Quote
it could be added directly to the project.
Why, when the spirit of the bitcoin source is to use available libraries.  You are slowing down the build process to needlessly recompile a project when the sources are best kept in an already compiled once static library.  Do you think the gcc version of bitcoin recompiles the libraries every time?

You never mentioned the main library leveldb.  Have you done that?  If anything needed its own library, that would be the one.  And how do you do all the separate tests provided by the original sources in your scenario?

Also the sources for the programs would no longer be unified, which is not what we want.  We want one set of sources using the same versions of the same libraries.
 
It seems you are just a distraction trying to stick a wrench into the wheels of progress.
Quote
Quote

 Also the QT is doable, since we use it at my work, and we just integrated the sources to our source code tree and compile it together with our files. This way, people could just download the msvc solution and it would work out of the box without the need to install anything else.
2.  I'd rather not clutter up the solution any more than it already is.  I feel funny enough having put the QR code project in there now.  I use Qt and openssl in my work as well, but I think my team mates would have a fit if I tried to put them into the solution.  Currently, I build Qt/OpenSsl and give everyone the output in a zip file.  That seems to work the best, especially since we often have to switch back and forth between Qt versions.

Absolutely. Keep all four libraries separate.  Makes for a fast bitcoin rebuild.  In case this person thinks that one can't debug into the libraries he is sorely mistaken!  Since one built them in VS, the /MTd libraries debug all the way down "to the bottom"!  Just because MingW gcc libraries are somewhat tricky to configure for building on a Windows machine doesn't mean MSVC libraries are.  Actually they are quite a bit easier thanks to MS.

Ron





LTC: LUYiMVsrFQewUSPDasSKGzhyTPAkiTeSov BTC: 1DPvP6WoZzaNQ9Nxzd64hjYad1kyQzTTbx YAC: Y3ZggXDvnRJaRwtVGyGJwt6DMLN3EPQpQf 
The day is coming when a single carrot, freshly observed, will set off a revolution.  Paul Cezanne
greyman
Newbie
*
Offline Offline

Activity: 40
Merit: 0


View Profile WWW
January 15, 2014, 08:45:10 AM
 #17


That defeats the whole spirit of the libraries.  They should be separate static library builds to allow a simple rebuild of a newer library version, e.g. OpenSSL 1.0.1e in place of 1.0.1c.  Rebuild the MSVC static library project (minutes at the most) and simply relink the bitcoin project.  Keeping versions straight without library names would seem to quickly lead to insanity, don't you think?
....

I don't say you are not correct, but what you are saying in your post (also further down) is not exactly universal experience. Maybe you are very skilled in compiling and have working experience with 3rd party open source libraries, but it's not like this for many other people. Many programmers who knows only Visual Studio will not go to the end of the process successfully...to sum it up, you are making it easier that it is (I mean for new people especially).

Also, replacing the library with newer version don't always work. (for example with QT).

In my work, we have a source tree, and all 3rd party libraries are there, so you know exactly what you are compiling. That's especially helpful when someone new comes to a team - he just download the tree and compiles it from the root, and don't have to fiddle with installing this and installing that. And it doesn't take any more time during normal development, since those libs are compiled only once (the sources doesn't change). But I understand that the open source culture is different in this regard, it's more of a meritocracy. (I have better bragging rights, since I know more ;-)).

Anyway, the more important question is, how do we convince the main bitcoin developers to include visual studio support into the main development branch. ;-)
old c coder
Sr. Member
****
Offline Offline

Activity: 260
Merit: 250



View Profile WWW
January 15, 2014, 04:27:58 PM
 #18


That defeats the whole spirit of the libraries.  They should be separate static library builds to allow a simple rebuild of a newer library version, e.g. OpenSSL 1.0.1e in place of 1.0.1c.  Rebuild the MSVC static library project (minutes at the most) and simply relink the bitcoin project.  Keeping versions straight without library names would seem to quickly lead to insanity, don't you think?
....

I don't say you are not correct, but what you are saying in your post (also further down) is not exactly universal experience. Maybe you are very skilled in compiling and have working experience with 3rd party open source libraries, but it's not like this for many other people. Many programmers who knows only Visual Studio will not go to the end of the process successfully...to sum it up, you are making it easier that it is (I mean for new people especially).

Also, replacing the library with newer version don't always work. (for example with QT).

In my work, we have a source tree, and all 3rd party libraries are there, so you know exactly what you are compiling. That's especially helpful when someone new comes to a team - he just download the tree and compiles it from the root, and don't have to fiddle with installing this and installing that. And it doesn't take any more time during normal development, since those libs are compiled only once (the sources doesn't change). But I understand that the open source culture is different in this regard, it's more of a meritocracy. (I have better bragging rights, since I know more ;-)).

Anyway, the more important question is, how do we convince the main bitcoin developers to include visual studio support into the main development branch. ;-)

Hello greyman,

I see no problem with separate Github projects for building the static libraries for the four libraries in question.  But it should not be part of the bitcoin project on GitHub.  This is because those libraries were not created for bitcoin per se, they are for many projects.  Also, the build of a static (or dynamic) library may be (?) specific to the version of MSVC++ one is using!  At least the guides for building them at BerkeleyDB, Boost and OpenSSL seem to think so!  You cannot force someone to use a particular version of MSVC++ unless you have hired him (or her) and even then you may get flak Grin

As to separate GitHub projects, Phelix did something like that for gcc, see
https://github.com/phelixbtc/bitcoin/tree/0.8.5-EWB and the (now modified) original work by nitrogenetics
https://bitcointalk.org/index.php?topic=149479.msg1587734#msg1587734
I think there is a GitHub of that too.

I think a better solution would be to do videos for each of the four! Sort of like a walk-through for a video game Grin  Furthermore, a video would show the principles for MSVC "static librarying" independent  of VC version!

Today's Zen calendar is very appropriate:


I know we have dumbed down the educational system, but must we do it to software development too?

Just my $0.02

Ron





LTC: LUYiMVsrFQewUSPDasSKGzhyTPAkiTeSov BTC: 1DPvP6WoZzaNQ9Nxzd64hjYad1kyQzTTbx YAC: Y3ZggXDvnRJaRwtVGyGJwt6DMLN3EPQpQf 
The day is coming when a single carrot, freshly observed, will set off a revolution.  Paul Cezanne
JDS
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
January 28, 2014, 09:39:40 PM
 #19

Hi All,

Has anyone found a way to resolve the many VS2013 Compiler warnings?

Examples:


Warning   88   The 'YieldDuringToolExecution' attribute is not declared.   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets   843   9   Miscellaneous Files


Warning   12   The element 'ClCompile' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'PrecompiledHeaderOutputFile' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'PrecompiledHeader, AdditionalIncludeDirectories, AdditionalUsingDirectories, CompileAsManaged, ErrorReporting, WarningLevel, MinimalRebuild, DebugInformationFormat, PreprocessorDefinitions, Optimization, BasicRuntimeChecks, RuntimeLibrary, FunctionLevelLinking, FloatingPointModel, IntrinsicFunctions, PrecompiledHeaderFile, MultiProcessorCompilation, UseUnicodeForAssemblerListing, UndefinePreprocessorDefinitions, StringPooling, BrowseInformation, FloatingPointExceptions, CreateHotpatchableImage, RuntimeTypeInfo, OpenMPSupport, CallingConvention, DisableSpecificWarnings, ForcedIncludeFiles, ForcedUsingFiles, ShowIncludes, UseFullPaths, OmitDefaultLibName, TreatSpecificWarningsAsErrors' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'.   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets   215   10   Miscellaneous Files
Claire123 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
February 07, 2014, 03:49:22 AM
 #20

Sorry, I cannot help with VS 2013.

I created an Ubuntu 12.04 64-bit virtual machine and built the Qt application from my latest source (as of today) and ran for a while to make sure that it downloaded blocks without errors.  I used the .pro file from the github 0.8.6 branch, which required a slight tweak to compile with Qt 5.1...I know it's not an exhaustive test but I tried Smiley

Also, the first post has been updated with new information and a link to my new codeplex project for a port of Litecoin source.
Pages: [1] 2 3 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!