Post
Topic
Board Development & Technical Discussion
Re: Building headless Bitcoin and Bitcoin-qt on Windows
by
old c coder
on 16/01/2017, 18:38:17 UTC
How does one build qt 4.8 projects on qt 5?
I use the greaterThan(QT_MAJOR_VERSION, 4): QT += widgets and added -static but the compiled file throws runtime errors on opening or sometimes closing. Is there anything else to do?
I don't know about building a 4.8.x bitcoinQt on a Qt 5.x system?  But when I build 4.8.x on a 4.8.x (Windows 8.1) system, I found I got similar errors if I didn't delete all the .obj & other files in the build directory.  The make file isn't too bright about what needs to be compiled and what doesn't.

Ron


My build dir is already clean. I compiled a clean source. No luck so far. I think this runtime has to do with how qt is not statically linking libs. I pasted some dlls into the coins release folder but no dice.
Looking at http://www.qtcentre.org/threads/27729-statically-link-Qt-libraries-%28not-build-static-library%29 I tried the suggestions there and I still ended up with a dynamically linked bitcoin-qt.exe or *coin-qt.exe

If you look at message #1 in this forum it is not clear what Qt is created on one's system.  I did read, but can't find the link now, that one needs to build a set of libraries for Qt that are dynamic for the use of Qt creator and Qt designer (if you use them) and a set that is static for building one's applications.  I don't know if that is so, nor how one would keep the environment straight Huh Smiley

Ron

I still haven't figured this one out. And I stopped hacking at it for now. Did you find anything helpful?

I use this and it works fine

Quote
greaterThan(QT_MAJOR_VERSION, 4) {
    QT += widgets
    DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
}

if you have errors, post them here, so people can help you.


I have that in my code. My qt version is 5.3. The app starts fine. When I open debug window and enter any word or whenever I close the wallet. it closes with generic "this application has requested the runtime to terminate in an unusual way"
I noticed the final qt file size is only 9.few mb which is low if qt would statically link libs.
Hello,

How big is your Qt exe? ~7MB?  27MB?

I can't find the actual link, but here is a parallel discussion,
http://tdm-gcc.tdragon.net/quirks
which I think is apropos.  It seems that there are some exceptions being thrown due to the Qt linking perhaps?

I found similar errors going back to linking bitcoin-qt 0.8.1!  I was able to get rid of them and get a stable exe by removing the link arguments
 
Code:
-static-libgcc \
-static-libstdc++ \
-static \
The test for me was using any command in the help->debug window->console, in addition to your actions.  But this is for Qt 4.8.4, not 5.x

Ron