• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

Compiling the source in Visual Studio

Travis9x

New member
I searched and didn't find any threads already related to this, so I apologize if it has indeed already been discussed elsewhere.
I am a student of IT and computer technology in general, and years ago took some courses in C/C++, and would like to get back into coding & such. I just recently got my hands on the full Microsoft Visual Studio Pro 2013 suite, and I would like to start by compiling some open-source projects that I'm familiar with. I love cryptocurrency, and am a big fan of Darkcoin especially.
So I would like to know how I might begin with compiling the latest Darkcoin release code, with Visual Studio. I downloaded the code, but from what I've read so far Darkcoin Qt was built on a Linux platform, and was cross-built for Windows from that same platform. I'm not even sure what language it is written in. In short, I'm kinda lost, and need some help. If someone could at least point me in the right direction, that would be a big help, and if someone could walk me through it, that would be very much appreciated!
With time, I hope to become good enough that I may even be able to provide valuable contribution to the community. Thanks in advance!
- Travis
 
Welcome to the forum :)

So I would like to know how I might begin with compiling the latest Darkcoin release code, with Visual Studio. I downloaded the code, but from what I've read so far Darkcoin Qt was built on a Linux platform, and was cross-built for Windows from that same platform.


This is correct, currently we are cross compiling Darkcoin for Windows and Mac OSX on Linux, using mingw-win32 and clang compiler toolchains.

I'm not even sure what language it is written in. In short, I'm kinda lost, and need some help.

Darkcoin, as all Bitcoin/Litecoin clones, is written in C++/C, using Qt application framework for the GUI.

If someone could at least point me in the right direction, that would be a big help, and if someone could walk me through it, that would be very much appreciated!

I have not tried using MSVC for compiling Bitcoin/Litecoin/Darkcoin yet, but it is is possible - nevertheless a tedious task :)

Your approach could be to get Bitcoin compiling on MSVC first.
There is a MSVC port of Bitcoin 0.8.6 (which is very close to Darkcoins' codebase) at https://bitcoinqtmsvc2012.codeplex.com with a lot of helper-scripts and manual where you can derive how the process is. Basically it boils down to compile all dependencies of *coin first (boost, miniupnp, qrencode, qt, leveldb) and then create buildfiles for Darkcoin for MSVC.

With time, I hope to become good enough that I may even be able to provide valuable contribution to the community. Thanks in advance!

Feel free to let me know your progress, i will try to support you as far as possible. I am very interested to get another IDE supporting Darkcoin Development :)
 
Last edited by a moderator:
Thanks, that is a lot of very helpful information! Bit by bit, I'm reading guides, tinkering with some tutorials, and compiling simple projects I find on GitHub. I'll certainly keep you updated on progress with the Darkcoin code, and if I can successfully create a MSVC port, I'll be sure to make it available for all the Darkcoin developer community to look at & use (if they want). :)
 
Thanks, that is a lot of very helpful information! Bit by bit, I'm reading guides, tinkering with some tutorials, and compiling simple projects I find on GitHub. I'll certainly keep you updated on progress with the Darkcoin code, and if I can successfully create a MSVC port, I'll be sure to make it available for all the Darkcoin developer community to look at & use (if they want). :)

Spent some time on this and managed to get it compiling Bitcoin with Microsoft Visual Studio Express 2013 for Windows Desktop.

8MnaJ.jpg


When i finally get it to build Darkcoin i will write a howto step-by-step guide on this :)
 
Good work, it's good to have windows users able to compile their own wallets for sure.

Actually, everyone should be compiling his own wallet to make sure it's not phishy.
 
Spent some time on this and managed to get it compiling Bitcoin with Microsoft Visual Studio Express 2013 for Windows Desktop.

When i finally get it to build Darkcoin i will write a howto step-by-step guide on this :)
That's great! Thanks so much for the help, I have to admit I haven't been able to spend much time on this project specifically lately, but I am still practicing and doing some problem-solving with MSVC and other code projects a little bit each day. This will definitely get me back to looking at the DarkCoin source again. :)

Good work, it's good to have windows users able to compile their own wallets for sure.
Actually, everyone should be compiling his own wallet to make sure it's not phishy.
I agree completely. ;)
 
I imported the DarkCoin project into Visual Studio, and made a few tweaks to make it compatible (ie, Unicode). First attempt to compile: 172 errors. :confused:
Almost all the errors are about "no such file or directory", so I'm sure there's some simple little change necessary that'll be really easy once I find it. Sample of the errors:
Code:
Error   1   error C1083: Cannot open include file: 'boost/type_traits/is_fundamental.hpp': No such file or directory   c:\users\travis\onedrive\documents\visual studio projects\darkcoin-master\src\serialize.h   17   1   DarkCoin
Error   2   error C1083: Cannot open include file: 'boost/algorithm/string/classification.hpp': No such file or directory   C:\Users\Travis\OneDrive\Documents\Visual Studio Projects\darkcoin-master\src\alert.cpp   6   1   DarkCoin
Error   3   error C1083: Cannot open include file: 'openssl/bn.h': No such file or directory   c:\users\travis\onedrive\documents\visual studio projects\darkcoin-master\src\bignum.h   10   1   DarkCoin
Error   4   error C1083: Cannot open include file: 'boost/type_traits/is_fundamental.hpp': No such file or directory   c:\users\travis\onedrive\documents\visual studio projects\darkcoin-master\src\serialize.h   17   1   DarkCoin
Error   5   error C1083: Cannot open include file: 'boost/assign/list_of.hpp': No such file or directory   C:\Users\Travis\OneDrive\Documents\Visual Studio Projects\darkcoin-master\src\checkpoints.cpp   5   1   DarkCoin
Looking forward to that guide, Flare! :wink:
 
Great start on the guide, but I'm getting the following errors when trying to compile libleveldb -
Code:
Error    2    error C2664: 'DWORD GetFileAttributesW(LPCWSTR)' : cannot convert argument 1 from 'const char *' to 'LPCWSTR'    C:\…\darkcoin-0.9.13.15\src\leveldb\util\env_win.cc    912    1    libleveldb
Error    3    error C2664: 'BOOL CreateDirectoryW(LPCWSTR,LPSECURITY_ATTRIBUTES)' : cannot convert argument 1 from 'const char *' to 'LPCWSTR'    C:\…\darkcoin-0.9.13.15\src\leveldb\util\env_win.cc    919    1    libleveldb
Error    4    error C2146: syntax error : missing ';' before identifier 'RandomPeriod'    C:\…\darkcoin-0.9.13.15\src\leveldb\db\db_iter.cc    107    1    libleveldb
Error    5    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    C:\…\darkcoin-0.9.13.15\src\leveldb\db\db_iter.cc    107    1    libleveldb
Error    7    error C2146: syntax error : missing ';' before identifier 'bytes_counter_'    C:\…\darkcoin-0.9.13.15\src\leveldb\db\db_iter.cc    123    1    libleveldb
Error    8    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    C:\…\darkcoin-0.9.13.15\src\leveldb\db\db_iter.cc    123    1    libleveldb
Error    9    error C2614: 'leveldb::`anonymous-namespace'::DBIter' : illegal member initialization: 'bytes_counter_' is not a base or member    C:\…\darkcoin-0.9.13.15\src\leveldb\db\db_iter.cc    60    1    libleveldb
Error    10    error C2065: 'ssize_t' : undeclared identifier    C:\…\darkcoin-0.9.13.15\src\leveldb\db\db_iter.cc    132    1    libleveldb
Error    11    error C2146: syntax error : missing ';' before identifier 'n'    C:\…\darkcoin-0.9.13.15\src\leveldb\db\db_iter.cc    132    1    libleveldb
Error    12    error C2065: 'n' : undeclared identifier    C:\…\darkcoin-0.9.13.15\src\leveldb\db\db_iter.cc    132    1    libleveldb
Error    13    error C2065: 'bytes_counter_' : undeclared identifier    C:\…\darkcoin-0.9.13.15\src\leveldb\db\db_iter.cc    133    1    libleveldb
Error    14    error C2065: 'n' : undeclared identifier    C:\…\darkcoin-0.9.13.15\src\leveldb\db\db_iter.cc    133    1    libleveldb
Error    15    error C2065: 'bytes_counter_' : undeclared identifier    C:\…\darkcoin-0.9.13.15\src\leveldb\db\db_iter.cc    134    1    libleveldb
Error    16    error C1903: unable to recover from previous error(s); stopping compilation    C:\…\darkcoin-0.9.13.15\src\leveldb\db\db_iter.cc    134    1    libleveldb
Error    17    error C1083: Cannot open include file: 'unistd.h': No such file or directory    C:\…\darkcoin-0.9.13.15\src\leveldb\db\c.cc    8    1    libleveldb
 
Hello,

Can anyone provide some assistance or guide wen it comes to building the source code in visual studio please?
 
I started a guide some time ago, but had no time to finish it yet :-/

In the end it works, after applying some patches to the Darkcoin source...

cw5G9.jpg
 
Apologies for reviving a 3 year old thread, but this seems like the thread with the most discussion about this particular topic.

I'm looking to compile the current Dash source in Visual Studio 2017 and don't really know where to start. It's been about 8 years since I've used a version of Visual Studio, so any help would be appreciated.

From my understanding (based off @flare 's wiki guide that was started and abandoned a while back), I need to create a visual studio 'solution' and then in that create separate projects for each of the main components.

At this stage, the main thing I want to be able to build is the dash wallet qt. Can anyone give me some hints at what component projects I'll need to set up to be able to successfully compile and run the wallet?

Currently I'm staring down the src folder from git which includes 75 folders and 1100 files and I'm unclear which ones are relevant to the wallet. Is my best bet to try to recreate the contents of Makefile.qt.include as a project?
 
I assume you mean this documentation: https://dashpay.atlassian.net/wiki/spaces/DOC/pages/1867823/Building+on+Visual+Studio+2013+Windows

I recently asked flare this question as well and he said attempting to do this is (I quote) "asking for a world of pain". Cross compiling or even gitian builds for Windows are well documented, is there a particular reason you don't want to do this? Otherwise I would be very interested in your results so we can update the wiki with a functioning guide for Visual Studio...
 
The only specific reason would be that Visual Studio is the IDE I'm most familiar with for C++ development, but I guess I can still use the IDE to develop even if I'm not using it to do the compiling.

So you'd recommend the gitian builds as the simplest way to compile on windows?
 
I'm not really a developer so I can't recommend much - I just write the documentation. That said, I have documented my success in creating Gitian deterministic builds and modified a bitcoin shell script to simplify the process: https://dashpay.atlassian.net/wiki/spaces/DOC/pages/119439468/Gitian+deterministic+builds

Deterministic building probably isn't necessary if you're just trying some new things and writing code though. Just a straight cross compile using Linux build tools without the Gitian VM would probably be faster.
 
IF i find time, I'd really like to try to get it compiling with VS again. The main pain points were the dependency libraries (boost, zlib, openssl, ...) back then. If you made it through that, compiling Dash was "easy going" :)
 
Back
Top