title: Nextcloud Desktop-Client build procedure
body: <p>Good day everybody.</p>
  
  <p>I used this instructions from Git on how to build the nextcloud client: <a href="https://github.com/nextcloud/desktop/wiki/How-to-compile-the-desktop-client" rel="nofollow noreferrer">https://github.com/nextcloud/desktop/wiki/How-to-compile-the-desktop-client</a></p>
  
  <p>I want to explain what I did and what tried to get the nextcloud client running:</p>
  
  <ol>
  <li>I created a new virtual machine with Windows 10 to get clean environment for my tests</li>
  </ol>
  
  <p><strong>Installing Qt</strong></p>
  
  <ol start="2">
  <li>I downloaded the Qt installer from <a href="https://www.qt.io/download-qt-installer?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f-9bb5-4778-ab02-bfb62735f3e5" rel="nofollow noreferrer">https://www.qt.io/download-qt-installer?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f-9bb5-4778-ab02-bfb62735f3e5</a></li>
  <li>In the Qt Setup Wizard I selected Qt 5.11.0 and MinGW 4.9.1 to install.</li>
  <li>To my PATH variable I added C:\...\Qt\5.11.0</li>
  </ol>
  
  <p><strong>CMake</strong></p>
  
  <ol start="5">
  <li>I downloaded the Windows win64-x64 Installer from <a href="https://cmake.org/download/" rel="nofollow noreferrer">https://cmake.org/download/</a> and installed it</li>
  <li>To my PATH variable I added C:\...\Cmake\bin</li>
  </ol>
  
  <p><strong>Zlib</strong></p>
  
  <ol start="7">
  <li>I downloaded the 64 bit release from <a href="https://github.com/maxirmx/Dist_zlib" rel="nofollow noreferrer">https://github.com/maxirmx/Dist_zlib</a> and unzipped the folder</li>
  <li>To my PATH variable I added C:\...\Zlib\bin and C:\...\Zlib\lib</li>
  </ol>
  
  <p><strong>QtKeychain</strong></p>
  
  <ol start="9">
  <li>I cloned the repository from <a href="https://github.com/frankosterfeld/qtkeychain.git" rel="nofollow noreferrer">https://github.com/frankosterfeld/qtkeychain.git</a> build it and got three files: qt5keychain.dll, qt5keychain.exp, qt5keychain.lib</li>
  <li>To my PATH variable I added C:\...\QtKeychain\Release which contains these three files</li>
  </ol>
  
  <p><strong>OpenSSL</strong></p>
  
  <ol start="11">
  <li>The link to the index of OpenSLL provided at <a href="https://github.com/nextcloud/desktop/wiki/System-requirements-for-compiling-the-desktop-client" rel="nofollow noreferrer">https://github.com/nextcloud/desktop/wiki/System-requirements-for-compiling-the-desktop-client</a> does not provide any OpenSSL 1.1.x version. The newest one provided is 1.0.2. So I searched a bit and I downloaded Win64 OpenSSL v1.1.0i from <a href="https://slproweb.com/products/Win32OpenSSL.html" rel="nofollow noreferrer">https://slproweb.com/products/Win32OpenSSL.html</a>.</li>
  <li>To my PATH variable I added C:\...\OpenSSL-Win64\bin which contains openssl.exe, libcrypto-1_1-x64.dll, openssl.cfg and so on</li>
  </ol>
  
  <p><strong>Git</strong></p>
  
  <ol start="13">
  <li>I downloaded the Git installer from <a href="https://git-scm.com/downloads" rel="nofollow noreferrer">https://git-scm.com/downloads</a> and made no changes in the installer and installed it</li>
  </ol>
  
  <p><strong>Visual Studio</strong></p>
  
  <ol start="14">
  <li>I installed a VS 2017 Community Edition with the C++ package and the following additional components:
  Visual C++ Tools for CMake
  Windows 10 SDK for UWP C++
  (not sure if that is all)</li>
  </ol>
  
  <p><strong>Creating the nextcloud poject files</strong></p>
  
  <ol start="15">
  <li>In Git Bash I navigated to /c/.../nextcloud/desktop/</li>
  <li>I run:
  'mkdir build'</li>
  <li>Navigated to /c/.../nextcloud/desktop/cmake\ and run:<br>
  <code>cmake -G "Visual Studio 15 2017 Win64" .. -DCMAKE_INSTALL_PREFIX=/c/.../nextcloud/desktop/build/ -DQTKEYCHAIN_INCLUDE_DIR=/c/QTKeychain/Release/ -DCMAKE_BUILD_TYPE=Debug -DNO_SHIBBOLETH=1</code></li>
  <li>Done (no errors)</li>
  </ol>
  
  <p><strong>Build the nextcloud client</strong></p>
  
  <ol start="19">
  <li><p>In /c/.../nextcloud/desktop/cmake I run:<br>
  <code>cmake --build . --config Debug --target nextcloud</code></p></li>
  <li><p>Got the error that file clientsideencryption.cpp and httpcredentials.cpp cannot find keychain.h and qkeychain_export.h, so I copied these two files (and keychain.cpp) from the QtKeychain repository to where the files are localed under desktop/src/libsync and the errors don't occour anymore</p></li>
  <li>Run 19. again and now I got over 50 errors like:
  
  <blockquote>
    <p>clientsideencryption.obj : error LNK2019: Unresolved external symbol "BIO_read" referenced in function ""class QByteArray __cdecl OCC::'anonymous namespace'::BIO2ByteArray(struct bio_st *)" (?BIO2ByteArray@?A0xd4adced4@OCC@@ya?AVQByteArray@@PEAUbio_st@@@z)". [C:\Nextcloud_64\desktop\cmake\src\libsync\nextcloudsync.vcxproj]<br><br>
    clientsideencryption.obj : error LNK2019: Unresolved external symbol "BIO_write" referenced in function ""class QByteArray __cdecl OCC::EncryptionHelper::privateKeyToPem(class QSslKey)" (?privateKeyToPem@EncryptionHelper@OCC@@ya?AVQByteArray@@VQSslKey@@@z)". [C:\Nextcloud_64\desktop\cmake\src\libsync\nextcloudsync.vcxproj]</p>
  </blockquote></li>
  </ol>
  
  <p>I am not sure if this problem comes form OpenSLL or QtKeychain. Do I something missed copying or connect somehow?</p>
  
  <p>Can anyone tell if hat is right what I am doing and if there is any way to get the client build?</p>
  
  <p>Thank you very much in advance</p>