Win32 build instructions don't work #681

issue NYCBrit opened this issue on December 3, 2011
  1. NYCBrit commented at 7:30 PM on December 3, 2011: none

    I'm following the Windows build instructions in readme-qt.rst

    Firstly, I've added "USE_UPNP=-" to the qmake additional arguments, as it appears to be on by default.

    Secondly, I'm stuck with a missing reference to several functions. Any suggestions?

    g++ -c -g -frtti -fexceptions -mthreads -fdiagnostics-show-option -Wall -Wno-strict-aliasing -Wno-invalid-offsetof -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare -Wno-char-subscripts -Wno-unused-value -Wno-sequence-point -Wno-parentheses -Wno-unknown-pragmas -Wno-switch -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_GUI -DBOOST_THREAD_USE_LIB -DWIN32 -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\svnroot\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore" -I"..\..\..\svnroot\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtGui" -I"..\..\..\svnroot\QtSDK\Desktop\Qt\4.7.4\mingw\include" -I"..\source\src" -I"..\source\src\json" -I"..\source\src\qt" -I"..\..\..\svnroot\QtSDK\Desktop\Qt\4.7.4\mingw\include\ActiveQt" -I"build" -I"build" -I"." -I"..\..\..\svnroot\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\win32-g++" -o build\qrc_bitcoin.o debug\qrc_bitcoin.cpp
    g++ -mthreads -Wl,-subsystem,windows -o debug\bitcoin-qt.exe object_script.bitcoin-qt.Debug  -L"g:\svnroot\QtSDK\Desktop\Qt\4.7.4\mingw\lib" -lmingw32 -lqtmaind build\bitcoin-qt_res.o -lws2_32 -lgdi32 -lssl -lcrypto -ldb_cxx -lboost_system-mgw44-mt-1_43 -lboost_filesystem-mgw44-mt-1_43 -lboost_program_options-mgw44-mt-1_43 -lboost_thread-mgw44-mt-1_43 -lQtGuid4 -lQtCored4 -LC:\OpenSSL-Win32_full\lib 
    mingw32-make[1]: Leaving directory `G:/svnRoot/bitcoin/bitcoin-qt-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0xee0): undefined reference to `CreateDCA@16'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0xeef): undefined reference to `CreateCompatibleDC@4'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0xf08): undefined reference to `GetDeviceCaps@8'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0xf23): undefined reference to `GetDeviceCaps@8'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0xf44): undefined reference to `CreateCompatibleBitmap@12'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0xf5b): undefined reference to `SelectObject@8'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0xf7e): undefined reference to `GetObjectA@12'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0x1024): undefined reference to `BitBlt@36'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0x103b): undefined reference to `GetBitmapBits@12'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0x10b0): undefined reference to `SelectObject@8'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0x10bb): undefined reference to `DeleteObject@4'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0x10c8): undefined reference to `DeleteDC@4'
    g:/svnroot/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(rand_win.o):rand_win.c:(.text+0x10d5): undefined reference to `DeleteDC@4'```
    
  2. gavinandresen commented at 8:28 PM on December 3, 2011: contributor

    I've heard that adding -lgdi helps-- if I'm recalling correctly, OpenSSL on Windows reads the screen to get more randomness for its random-number-generator.

  3. NYCBrit commented at 11:11 PM on December 3, 2011: none

    -lgdi32 is already referenced. Finally solved it, it's an ordering problem. Adding -lcrypto before -lgdi32 in bitcoin-qt.pro fixed it

  4. NYCBrit closed this on Dec 3, 2011

  5. TheBlueMatt commented at 2:04 AM on December 4, 2011: member

    Should we do this by default in the .pro?

  6. NYCBrit commented at 2:43 AM on December 4, 2011: none

    I can't test it on multiple Windows builds, but since it works for me I'd say yes. I'm a git beginner, so please submit it for me, thanks.

  7. TheBlueMatt referenced this in commit 3f9144d42c on Dec 4, 2011
  8. TheBlueMatt commented at 2:52 AM on December 4, 2011: member

    Can you confirm that the above commit fixes it?

  9. luke-jr referenced this in commit f66eabd281 on Dec 5, 2011
  10. NYCBrit commented at 2:24 AM on December 6, 2011: none

    Yes that worked thanks

  11. TheBlueMatt referenced this in commit 16e7c05de7 on Feb 10, 2012
  12. coblee referenced this in commit 1cbf342a8f on Jul 17, 2012
  13. coblee referenced this in commit 8d2e93ab50 on Jul 17, 2012
  14. jpentland referenced this in commit 8143059f41 on Feb 7, 2016
  15. ptschip referenced this in commit 01952404a2 on Jul 11, 2017
  16. rajarshimaitra referenced this in commit ea0b8f1b7b on Aug 5, 2021
  17. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me