Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [solved] QT Creator 5.0.2 static build
Forum Updated to NodeBB v4.3 + New Features

[solved] QT Creator 5.0.2 static build

Scheduled Pinned Locked Moved Installation and Deployment
30 Posts 2 Posters 31.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • QT-static-prgmQ Offline
    QT-static-prgmQ Offline
    QT-static-prgm
    wrote on last edited by
    #4

    mh i have some problem with this again.

    So i now have installed: QT Creator 5.0.2 32bit MinGW.

    The files you gave me.
    The Path are:
    C:\Qt\Qt5.0.2...
    C:\Qt\Qt static...

    in C:\Qt\Qt static\mkspecs\win32-g++\qmake.conf i changed the following:

    QMAKE_CFLAGS_RELEASE = -Os -momit-leaf-frame-pointer | removed the other things
    QMAKE_LFLAGS = -static -static-libgcc … | added this, there where nothing by default
    DEFINES += QT_STATIC_BUILD | removed the other things

    C:\Qt\Qt static\qmake\Makefile.win32-g++:

    LFLAGS = -static -static-libgcc … | so now it looks like -static -static-libgcc -s
    

    C:\Qt\Qt static\src\3rdparty\webkit\Source\WebKit.pri :

    CONFIG += staticlib added this at line 2.
    

    Than i startet the console from QT Creator 5.0.2 changed to C:\Qt\Qt static
    my inputs:
    configure -static -release -platform win32-g++ -no-exceptions
    o
    y

    The last output lines:
    mingw32-make: *** No rule to make target 'C:\Qt\Qt', needed by 'project.o'. Stop.
    del many o-files
    C:\Qt\Qt static\qmake\project.o konnte nicht gefunden werden
    mingw32-make: *** No rule to make target 'C:\Qt\Qt' needed by 'project.o'. Stop
    Building qmake failed, return code 2

    I hope you can help me

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #5

      hmmm ??

      I have not build Qt 5.0 myself in any version yet. Unfortunately, the static build I did was under Linux with Qt 4.6.x version. That was really very easy besides the waiting time. No changes of conf files required IIRC.

      You need to make sure that another version is available through the path settings I guess. However, that should be already the case anyway, otherwise you have not compiled apparently already a lot of stuff.

      Oh, I think i t could be the forward/backward slash problem. If you have typed in the files somewhere a path, you have to use '/' the backward version is often used for continuation lines. The forward slash is standard in Linux but Windows understands it too. Everything with folder separation in Qt should be done with forward slash '/'. Saves a lot of trouble.

      Furthermore, if you have decided the folder name "C:\Qt\Qt static", use something with a space e.g. "C:/Qt/Qt_static" should be fine.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • QT-static-prgmQ Offline
        QT-static-prgmQ Offline
        QT-static-prgm
        wrote on last edited by
        #6

        ok the / \ thing i managed it was the qt space static now it made a lot more things, but no i get error return 3 :D

        What is the maximum error code?? XD

        But seams to be something simple
        Generating Makefiles...
        Failure to read QMAKESPEC conf file c:\QT\QT5.0.2\Src\qtbase\mkspecs\win32-g++\qmake.conf.
        Error processing project file: C:/QT/QT_static/Projects.pro
        Qmake failed, return code 3

        So why is the qmake process doing something in the Qt5.0.2 folder?? it shouldn't

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #7

          Do not start the command prompt through creator. That might be the problem. Start the cmd.exe under "Start" or whatever it is in your version. Creator will add its own environment, which you do not want.

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • QT-static-prgmQ Offline
            QT-static-prgmQ Offline
            QT-static-prgm
            wrote on last edited by
            #8

            WUHU the first step runs without problems :D

            I added the QDIR in the enviroment Variables in the past and that showed to the wrong path :D changed, restart and than it worked :D

            but not the mingw32-make -.-

            @C:\Qt\Qt_static>mingw32-make sub-src
            cd src\tools\bootstrap\ && mingw32-make -f Makefile
            mingw32-make[1]: Entering directory 'C:/Qt/Qt_static/src/tools/bootstrap'
            mingw32-make -f Makefile.Release
            mingw32-make[2]: Entering directory 'C:/Qt/Qt_static/src/tools/bootstrap'
            g++ -c -pipe -Os -momit-leaf-frame-pointer -frtti -fno-exceptions -Wall -Wextra
            -DQT_STATIC_BUILD -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -D
            QT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_
            NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -
            DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -
            DQT_NODLL -I"......\include" -I"......\include\QtCore" -I"......\include\Q
            tXml" -I"......\mkspecs\win32-g++" -o tmp\obj\release_static\qglobal.o ....\c
            orelib\global\qglobal.cpp
            ....\corelib\global\qglobal.cpp: In function 'QString qt_error_string(int)':
            ....\corelib\global\qglobal.cpp:2192:27: error: cannot convert 'LPWSTR {aka wch
            ar_t*}' to 'LPSTR {aka char*}' for argument '5' to 'DWORD FormatMessageA(DWORD,
            LPCVOID, DWORD, DWORD, LPSTR, DWORD, char**)'
            Makefile.Release:998: recipe for target 'tmp/obj/release_static/qglobal.o' faile
            d
            mingw32-make[2]: *** [tmp/obj/release_static/qglobal.o] Error 1
            mingw32-make[2]: Leaving directory 'C:/Qt/Qt_static/src/tools/bootstrap'
            Makefile:34: recipe for target 'release' failed
            mingw32-make[1]: *** [release] Error 2
            mingw32-make[1]: Leaving directory 'C:/Qt/Qt_static/src/tools/bootstrap'
            makefile:1365: recipe for target 'sub-tools-bootstrap-sub_src_target_ordered' fa
            iled
            mingw32-make: *** [sub-tools-bootstrap-sub_src_target_ordered] Error 2

            C:\Qt\Qt_static>
            @

            hope this says something to you. Google sayed there is something wrong with the unicode (?) but not how to fix

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on last edited by
              #9

              Did you do a confclean before new configure?
              Could be a problem with some leftover from previous configuration.
              Do you have special settings with respect to unicode?

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • QT-static-prgmQ Offline
                QT-static-prgmQ Offline
                QT-static-prgm
                wrote on last edited by
                #10

                i did not a clean, because i made the steps from the wiki to clean up and it seams to me to be clean.

                settings are:
                -static -platfrom win32-g++ -release -no-exceptions

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #11

                  Do not know if this is enough.

                  At the end of configure it says something like
                  @
                  To reconfigure, run 'make confclean' and 'configure'
                  @

                  This text I have copied from the linux configure file, but the windows version displays something similar.

                  In your case probably
                  @
                  To reconfigure, run 'mingw32-make confclean' and 'configure'
                  @

                  A mixture of settings from your previous trials is my only explanation at the moment. So a confclean would be helpful.

                  I doubt that this is general problem, because it would be a bug.

                  Vote the answer(s) that helped you to solve your issue(s)

                  1 Reply Last reply
                  0
                  • QT-static-prgmQ Offline
                    QT-static-prgmQ Offline
                    QT-static-prgm
                    wrote on last edited by
                    #12

                    still the same problem. At an other PC it worked. to build QT staticly, but it couldn't build the project

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      koahnig
                      wrote on last edited by
                      #13

                      You are aware of differences between PCs?
                      Those differences might be the reason for your problem. :-(

                      Vote the answer(s) that helped you to solve your issue(s)

                      1 Reply Last reply
                      0
                      • QT-static-prgmQ Offline
                        QT-static-prgmQ Offline
                        QT-static-prgm
                        wrote on last edited by
                        #14

                        Jep i found it. fopr me i did all the steps i should do befor starting building. for the other i didn't. ANd i now know what the problem was. in makfile.conf the Define line says something about unicode. the last time i deletet all and replaced with the thing from the tut. this time i added the part from the tut and sice 1 hour it's building :D

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          koahnig
                          wrote on last edited by
                          #15

                          Good to know.

                          Typically it takes a bit of time.

                          Is there a problem with the German wiki entry?
                          If so, you should correct it. If you have doubt that it is general mark it as a difference for building Qt 5.

                          If you want I can proof read.

                          Vote the answer(s) that helped you to solve your issue(s)

                          1 Reply Last reply
                          0
                          • QT-static-prgmQ Offline
                            QT-static-prgmQ Offline
                            QT-static-prgm
                            wrote on last edited by
                            #16

                            Hi,

                            yes i think i'll make a report of what i made to get it running.

                            but before i need you help again.

                            I have no problem with building. The exe is 164.431KB big.

                            looks good i think. But when open it nothing happens. and if i run it with QT i get the messege
                            Programm abgestürzt ..... Rückgabewert -1073741819
                            something know about this??

                            1 Reply Last reply
                            0
                            • K Offline
                              K Offline
                              koahnig
                              wrote on last edited by
                              #17

                              Well, what can I say besides that your app crashed :-(

                              You need to use the debugger and step through to the point where the app is crashing. Alternatively, you have to do it like our ancestors ( nach alter Väters Sitte ) put in some output statements where you think the application steps through.

                              With MinGW you can use gdb for debugging. When debugging you can look at the values, if there is something wrong and stuff. If you haven't done before, it is good thing to look at, if you have done before, sorry for telling the obvious stuff.

                              Sometimes it is good to make a mixed approach debugging and output statements. BTW for output during your debug session "qDebug()":http://qt-project.org/doc/qt-5.0/qtcore/qdebug.html is very helpful. You can do a lot of neat stuff with it.

                              You can use more or less as cerr and cout in standard c++.

                              By summarizing your findings you can update the wiki entry. Typically you have only a few things to add. So, it could be less work than writing a complete entry.

                              Vote the answer(s) that helped you to solve your issue(s)

                              1 Reply Last reply
                              0
                              • QT-static-prgmQ Offline
                                QT-static-prgmQ Offline
                                QT-static-prgm
                                wrote on last edited by
                                #18

                                thanks for the link to the debug Class. That's really new for me.

                                Normaly i debugg with couts :D

                                the problem is, that this programm i wanted to be static has no errors.

                                because it's a complete clean new QT applicattion.
                                just made
                                file>new>qt c++ application>next>next......
                                added CONFIG += static in the .pro file, build. and that's it. the building toke a very long time, but there where no errors.

                                1 Reply Last reply
                                0
                                • K Offline
                                  K Offline
                                  koahnig
                                  wrote on last edited by
                                  #19

                                  BTW it is Qt. QT stands for QuickTime.

                                  Oh, you got a "hello world" test application only. Or is it more?
                                  You are writing of a long compile time. What do you mean with long?

                                  I would assume that the problem is with the compile settings. A mixture of the "kit/tool chain". I doubt that just adding "static" to the .pro will do the job.

                                  To use qdebug I can really recommend. I used Qt already for a couple of years until I have started with qDebug. It looked cumbersome and why should you use when cout and cerr is available. However, together with Qt creator it makes sense and also you can more easily redirect the output stuff (e.g. to a file or a socket).

                                  Vote the answer(s) that helped you to solve your issue(s)

                                  1 Reply Last reply
                                  0
                                  • QT-static-prgmQ Offline
                                    QT-static-prgmQ Offline
                                    QT-static-prgm
                                    wrote on last edited by
                                    #20

                                    it's even less than a hello world. its an empty window that should apear.

                                    with long time i mean it seams to me to be minuts, but i think in real it was a bout 30 sec. for complex programms i made without static let'a take an Image Filter prgm it was just a few sec.

                                    i'll have a look at my test prgm in the afternoon. i have no pc here at the moment.

                                    1 Reply Last reply
                                    0
                                    • QT-static-prgmQ Offline
                                      QT-static-prgmQ Offline
                                      QT-static-prgm
                                      wrote on last edited by
                                      #21

                                      ok i just retest.

                                      file>new>qtapplication
                                      Kits:Desktop and desktop static
                                      Desktop, without static, works fine.
                                      Desktop with static, builds fine, but crashes.

                                      @#include "mainwindow.h"
                                      #include <QApplication>

                                      int main(int argc, char *argv[])
                                      {
                                      QApplication a(argc, argv);
                                      MainWindow w;
                                      w.show();

                                      return a.exec();
                                      }
                                      @

                                      @#include "mainwindow.h"
                                      #include "ui_mainwindow.h"

                                      MainWindow::MainWindow(QWidget *parent) :
                                      QMainWindow(parent),
                                      ui(new Ui::MainWindow)
                                      {
                                      ui->setupUi(this);
                                      }

                                      MainWindow::~MainWindow()
                                      {
                                      delete ui;
                                      }@

                                      you see it's a normal clean new Application.
                                      Also in the pro file i changed nothing.

                                      When debugging i get the error

                                      bq. Der Prozess wurde nach Erhalt eines Signals vom Betriebssystem angehalten
                                      Name des Signals: SIGSEGV
                                      Bedeutung: Segmentation fault

                                      Free translated:

                                      bq. The Prozess was stopped after receive a signal from operatingsystem
                                      Name of the signal: SIGSEGV
                                      Meaning: Segmentation fault

                                      So a friend got this a while ago, when using a pointer showing on a memory that was not from the Application. But this works without static and is a clean new App.
                                      I really hope someone can help me

                                      The debugger stopps showing me a file named qatomic_i386.h
                                      never heard something about this.
                                      I toke the time it takes to build:
                                      static debugg: 20 sec
                                      static release : < 10sec
                                      normal debugg: < 5sec
                                      normal release: < 5sec

                                      1 Reply Last reply
                                      0
                                      • K Offline
                                        K Offline
                                        koahnig
                                        wrote on last edited by
                                        #22

                                        I assume you are using Qt creator for creating your app.

                                        What do you change when switching from dynamic to static build?

                                        The differences there are essential. My guess is that the compilation of the static app doesn't use a consistent memory model.

                                        In creator go to "Options"->"Build&Run" under the Tabs "Kits" and "Qt versions" you find what you have installed and accessible.
                                        On the left side of creator under "Projects" ->"Build&Run" you can find the actual kits used for your build. With manage kits, you have a link to the options menu.
                                        In the "Projects" menu you can switch between different setups.

                                        When switching setups, I found it helpful to rerun qmake from creator. This makes sure that you use the settings you see. For your small project it does not matter anyhow and it saves a lot of headaches. Use also shadow build.

                                        Probably you should post "part" of your error messages as displayed.

                                        PS: I am to lazy to translate the menu entries back to German. I prefer the English terms and have switched the language of creator a long time ago. ;-)

                                        Vote the answer(s) that helped you to solve your issue(s)

                                        1 Reply Last reply
                                        0
                                        • QT-static-prgmQ Offline
                                          QT-static-prgmQ Offline
                                          QT-static-prgm
                                          wrote on last edited by
                                          #23

                                          Yes. I have the Creator 5.0.2. There i made a new Project.
                                          File>new>Qt-Gui-Application
                                          Name: test
                                          Kit:
                                          Desktop Qt 5.0.2 MinGW 32bit
                                          Desktop Qt4.8.4 (Qt_static)

                                          Options>..>Qt Versions give me a ! at the Qt 4.8.4 (Qt_static) version.
                                          The details say Hilfskomponeten: keine verfügbar
                                          and Es ist kein qmlviewer installiert

                                          Options...>Kits There is also a ! at the static Kit.
                                          The Message is Warnung: Der Compiler ... erstellt möglicherweise keinen mit der Qt Version ... kompatiblen Code.

                                          So maybe it's because i use Qt 5.0.2 Creator and Qt 4.8.4 for static??

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved