Results 1 to 17 of 17

Thread: Problems when running "configure -static" for 4.7.3

  1. #1
    Join Date
    Mar 2011
    Posts
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Problems when running "configure -static" for 4.7.3

    Hi everyone,

    I'm trying to qmake a static version from the original 4.7.3. I've been looking around for a while, trying lots of things but I don't know where does my problem come from.

    I copy paste the source code of the 4.7.3 to make a new static version
    from: C:\QtSDK\QtSources\4.7.3
    to : C:\QtSDK\QtSources\4.7.3static

    i execute the command:
    C:\QtSDK\QtSources\4.7.3static>configure -static

    And I get loooooooooots of errors, it looks like it is not linking properly:
    Qt Code:
    1. C:\QtSDK\QtSources\4.7.3static>configure -static
    2. Which edition of Qt do you want to use ?
    3. Type 'c' if you want to use the Commercial Edition.
    4. Type 'o' if you want to use the Open Source Edition.
    5. o
    6.  
    7. This is the Qt for Windows Open Source Edition.
    8.  
    9. You are licensed to use this software under the terms of
    10. the GNU Lesser General Public License (LGPL) version 2.1.
    11.  
    12. Type 'L' to view the Lesser GNU General Public License version 2.1 (LGPLv2.1).
    13. Type 'y' to accept this license offer.
    14. Type 'n' to decline this license offer.
    15.  
    16. Do you accept the terms of the license?
    17. y
    18.  
    19. WARNING: Using static linking will disable the WebKit module.
    20.  
    21. Environment:
    22. INCLUDE=
    23. Unset
    24. LIB=
    25. Unset
    26. PATH=
    27. C:\QtSDK\Desktop\Qt\4.7.3\mingw\bin
    28. C:\QtSDK\mingw\bin
    29. C:\Windows\system32
    30. C:\Windows
    31. C:\Windows\System32\Wbem
    32. C:\Windows\System32\WindowsPowerShell\v1.0\
    33. C:\Program Files\MATLAB\R2009a\bin
    34. C:\Program Files\MATLAB\R2009a\bin\win32
    35. C:\LT\DLLwithEXE
    36. C:\Program Files\Creaform\VXelements\
    37. C:\Program Files\Creaform\VXelements\CTS
    38. c:\Program Files\Microsoft SQL Server\100\Tools\Binn\
    39. c:\Program Files\Microsoft SQL Server\100\DTS\Binn\
    40. C:\Program Files\Druide\Antidote
    41. You are licensed to use this software under the terms of the GNU GPL version 3.Y
    42. ou are licensed to use this software under the terms of the Lesser GNU LGPL vers
    43. ion 2.1.
    44. See C:/QtSDK/QtSources/4.7.3static3
    45.  
    46. or C:/QtSDK/QtSources/4.7.3staticL
    47.  
    48. Configuration:
    49. minimal-config
    50. small-config
    51. medium-config
    52. large-config
    53. full-config
    54. build_all
    55. debug
    56. Qt Configuration:
    57. release
    58. debug
    59. zlib
    60. gif
    61. tiff
    62. jpeg
    63. png
    64. mng
    65. accessibility
    66. qt3support
    67. opengl
    68. s60
    69. ipv6
    70. script
    71. scripttools
    72. xmlpatterns
    73. phonon
    74. phonon-backend
    75. multimedia
    76. audio-backend
    77. declarative
    78. native-gestures
    79. svg
    80. minimal-config
    81. small-config
    82. medium-config
    83. large-config
    84. full-config
    85.  
    86. QMAKESPEC...................win32-g++ (detected)
    87. Architecture................windows
    88. Maketool....................mingw32-make
    89. Debug symbols...............yes
    90. Link Time Code Generation...no
    91. Accessibility support.......yes
    92. STL support.................yes
    93. Exception support...........yes
    94. RTTI support................yes
    95. MMX support.................yes
    96. 3DNOW support...............yes
    97. SSE support.................yes
    98. SSE2 support................yes
    99. IWMMXT support..............no
    100. OpenGL support..............yes
    101. OpenVG support..............no
    102. OpenSSL support.............no
    103. QtDBus support..............no
    104. QtXmlPatterns support.......yes
    105. Phonon support..............yes
    106. QtMultimedia support........yes
    107. WebKit support..............no
    108. Declarative support.........yes
    109. Declarative debugging.......yes
    110. QtScript support............yes
    111. QtScriptTools support.......yes
    112. Graphics System.............raster
    113. Qt3 compatibility...........yes
    114.  
    115. Third Party Libraries:
    116. ZLIB support............qt
    117. GIF support.............yes
    118. TIFF support............yes
    119. JPEG support............yes
    120. PNG support.............yes
    121. MNG support.............yes
    122. FreeType support........no
    123.  
    124. Styles:
    125. Windows.................yes
    126. Windows XP..............yes
    127. Windows Vista...........yes
    128. Plastique...............yes
    129. Cleanlooks..............yes
    130. Motif...................yes
    131. CDE.....................yes
    132. Windows CE..............no
    133. Windows Mobile..........no
    134. S60.....................no
    135.  
    136. Sql Drivers:
    137. ODBC....................no
    138. MySQL...................no
    139. OCI.....................no
    140. PostgreSQL..............no
    141. TDS.....................no
    142. DB2.....................no
    143. SQLite..................yes (qt)
    144. SQLite2.................no
    145. InterBase...............no
    146.  
    147. Sources are in..............C:\QtSDK\QtSources\4.7.3static
    148. Build is done in............C:\QtSDK\QtSources\4.7.3static
    149. Install prefix..............C:\QtSDK\QtSources\4.7.3static
    150. Headers installed to........C:/QtSDK/QtSources/4.7.3static/include
    151. Libraries installed to......C:/QtSDK/QtSources/4.7.3static/lib
    152. Plugins installed to........C:/QtSDK/QtSources/4.7.3static/plugins
    153. Imports installed to........C:/QtSDK/QtSources/4.7.3static/imports
    154. Binaries installed to.......C:/QtSDK/QtSources/4.7.3static/bin
    155. Docs installed to...........C:/QtSDK/QtSources/4.7.3static/doc
    156. Data installed to...........C:/QtSDK/QtSources/4.7.3static
    157. Translations installed to...C:/QtSDK/QtSources/4.7.3static/translations
    158. Examples installed to.......C:/QtSDK/QtSources/4.7.3static/examples
    159. Demos installed to..........C:/QtSDK/QtSources/4.7.3static/demos
    160.  
    161. WARNING: Using static linking will disable the use of plugins.
    162. Make sure you compile ALL needed modules into the library.
    163. Creating qmake...
    164. g++ -c -oproject.o -O -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Ige
    165. nerators/mac -Igenerators/symbian -IC:\QtSDK\QtSources\4.7.3static/include -IC:\
    166. QtSDK\QtSources\4.7.3static/include/QtCore -IC:\QtSDK\QtSources\4.7.3static/incl
    167. ude -IC:\QtSDK\QtSources\4.7.3static/include/QtCore -IC:\QtSDK\QtSources\4.7.3st
    168. atic/src/corelib/global -IC:\QtSDK\QtSources\4.7.3static/src/corelib/xml -IC:\Qt
    169. SDK\QtSources\4.7.3static/mkspecs/win32-g++ -IC:\QtSDK\QtSources\4.7.3static/too
    170. ls/shared -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PC
    171. RE -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUI
    172. LD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM
    173. -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT -DQMAKE_OPENSOURCE_EDITION project.cpp
    174.  
    175. In file included from project.cpp:42:
    176. project.h:45:25: error: qstringlist.h: No such file or directory
    177. project.h:46:25: error: qtextstream.h: No such file or directory
    178. project.h:47:21: error: qstring.h: No such file or directory
    179. project.h:48:20: error: qstack.h: No such file or directory
    180. project.h:49:18: error: qmap.h: No such file or directory
    181. project.h:50:23: error: qmetatype.h: No such file or directory
    182. In file included from property.h:45,
    183. from project.cpp:43:
    184. C:\QtSDK\QtSources\4.7.3static/src/corelib/global/qglobal.h:62:28: error: QtCore
    185. /qconfig.h: No such file or directory
    186.  
    187. .............................................
    188.  
    189. mingw32-make: *** [project.o] Error 1
    190. Building qmake failed, return code 2
    To copy to clipboard, switch view to plain text mode 


    I don't know if that could be a problem with the paths, I checked and run the qtenv.bat file, it looks like this (which correspond to the correct paths):
    Qt Code:
    1. echo off
    2. echo Setting up environment for Qt usage...
    3. set QTDIR=C:\QtSDK\Desktop\Qt\4.7.3\mingw
    4. set PATH=C:\QtSDK\mingw\bin;%PATH%
    5. set PATH=%QTDIR%\bin;%PATH%
    To copy to clipboard, switch view to plain text mode 

    Thanks in advance!!

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Problems when running "configure -static" for 4.7.3

    I don't know if that could be a problem with the paths, I checked and run the qtenv.bat file, it looks like this (which correspond to the correct paths):
    Doesn't look correct to me:
    Sources are in..............C:\QtSDK\QtSources\4.7.3static
    and
    set QTDIR=C:\QtSDK\Desktop\Qt\4.7.3\mingw
    Don't exactly match.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Mar 2011
    Posts
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems when running "configure -static" for 4.7.3

    ooh thanks for your help!

    I copy pasted the original source from C:\QtSDK\QtSources\4.7.3 to make a backup, even if I use this path it doesn't work.

    and this path :
    QTDIR=C:\QtSDK\Desktop\Qt\4.7.3\mingw
    is the path for the compiler right? So they don't have to be in the same dir...

    I don't know how is it supposed to be, it came like that when I installed QtSDK with sources.
    Last edited by Cucus; 17th August 2011 at 17:03. Reason: didn't see last post

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Problems when running "configure -static" for 4.7.3

    QTDIR is not supposed to point to the compiler but to Qt, as the name suggests.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Mar 2011
    Posts
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems when running "configure -static" for 4.7.3

    I've tried several combinations with no success...
    I set the environment variables like this: (as you said, QtDIR points to QtCreator) (there is no Qt dir in version 4.7.3)
    set QTDIR=C:\QtSDK\QtCreator
    set PATH=C:\QtSDK\mingw\bin;%PATH%
    set PATH=%QTDIR%\bin;%PATH%
    Both directories in the path should point to a \bin directory?
    Thanks for your help

  6. #6
    Join Date
    Mar 2011
    Posts
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems when running "configure -static" for 4.7.3

    After lots of research on the web I realised that it is a known bug to build statically the QtSDK 4.7.1 or later.
    http://developer.qt.nokia.com/forums/viewthread/7644

    Could someone tell me where can I find the official and stable version of QtSDK 4.7.0?

    Thanks.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Problems when running "configure -static" for 4.7.3

    Why do you want to build static Qt from the SDK? Download source code for the libraries and have fun.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    10
    Thanked 13 Times in 12 Posts

    Default Re: Problems when running "configure -static" for 4.7.3

    The following steps worked fine for me:

    In summary, this is what worked (succeeded in both Windows Vista Home Premium 64-bit and Windows 7 Professional 64-bit):

    1. Install QtSDK (2009.05)

    2. Open your mkspecswin32-g++qmake.conf file (located in C:\Qt\2009.05\qt\mkspecs\win32-g++\qmake.conf) in an editor like notepad.

    3. Find the line that starts with "QMAKE_LFLAGS = -enable-stdcall-fixup..." and ddd the phrase "-static" (without quotes) after the "=" sign and before the "-enable..." phrase, so it looks like:
    QMAKE_LFLAGS = -static -enable-stdcall...

    4. Save and close this file.

    5. Set your environment variables. Right-click Computer >> Properties >> Advanced System Settings >> Click the "Environment Variables..." button.

    6. Under "User variables," make sure QTDIR is set to your Qt path (C:\Qt\2009.05\qt). Make sure QMAKESPEC is set to win32-g++.

    7. Under "System variables," edit the one called "Path." Add a semicolon ( ; ) to the end, and add the following:
    C:\Qt\2009.05\mingw\lib;C:\Qt\2009.05\mingw\bin;C: \Qt\2009.05\qt\bin

    8. When finished, relog or reboot.

    9. Open a command prompt.

    10. Change to your Qt directory by entering: cd C:\Qt\2009.05\qt

    11. Enter the following: configure -static -no-phonon -no-phonon-backend -release -no-exceptions

    12. When it asks which edition you want to use, enter "o" for open source.

    13. When it asks you to accept the terms of the license, enter "y" for yes. This will take around maybe 10 minutes to complete.

    14. When that finishes, enter the following: mingw32-make sub-src (or) nmake sub-src

    15. Go out to dinner, this will take a while (took between 1-2 hours for me).

    16. When this finishes, open your project in the Qt Creator.

    17. Double-click the project (.pro) file to open it in edit mode.

    18. Add the following line: CONFIG += static

    19. qmake Hello.pro
    nmake release (or) mingw32-make release

    20. Navigate to your release directory and voila! Your standalone executable should be there.

  9. #9
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    10
    Thanked 13 Times in 12 Posts

    Default Re: Problems when running "configure -static" for 4.7.3

    I don't have any problem in using the above steps: But my another application needs to be run as an administrator, how to make the exe to work as an administrator??

  10. #10
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Problems when running "configure -static" for 4.7.3

    This has nothing to do with static linking, nor Qt.
    On all systems that I know, the only way to run an application as admin, well, is to log in as admin, either in a prompt for this specific execution (when you are a regular user, such as 'sudo' or under windows "run as administrator") or, when you are logged on as as admin.
    Read the docs on the matter in the documentation of your OS.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Problems when running "configure -static" for 4.7.3

    You're wrong Daniel. At least on Linux and modern Windows you can elevate access rights. Well, on Linux it's a pseudo-elevation using PolicyKit, actually.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  12. #12
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Problems when running "configure -static" for 4.7.3

    I stand corrected then.
    I'll have to read about it...
    But on first thought, I makes little sense.
    If you can as a developer elevate your applications rights, what is the point if having them?
    If the system can't prohibit my application do access things the system deems as restricted, what is the point?
    But this still has nothing to do with static linking (unless the goal is to avoid linking privileged libs? but with admin rights that should not be a problem...)
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Problems when running "configure -static" for 4.7.3

    You can elevate if the system policy lets you (i.e. you know the password or the system is configured to let the particular application gain superuser rights). Nothing to do with static linking though
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  14. #14
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Problems when running "configure -static" for 4.7.3

    Ok, I still stand by what I said in post#10.
    Basically "elevating" boils down to "automating" what I wrote is needed in post#10.

    Off topic:
    And this here, demonstrates exactly the "non-sense" in allowing such a mechanism...
    http://www.withinwindows.com/2009/02...freely-easily/

    Yes, its dues to a bug and not a design problem, but who can claim to have written an application (of any serious volume) which is bug free?
    Such an feature is asking for security problems IMHO.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  15. #15
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    10
    Thanked 13 Times in 12 Posts

    Default Re: Problems when running "configure -static" for 4.7.3

    Actually, i did the static build by opening the command prompt as Administrator, but it fails to do the work after executing. I have tried "Run as administrator" still the same thing occurs. Nothing is happened, just the application window opens.

  16. #16
    Join Date
    Mar 2011
    Posts
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems when running "configure -static" for 4.7.3

    Wow thank you very much for your reply Gokulnathvc!
    It looks really complete the method you propose. I haven't tried it yet, I finally could manage it to work with version 4.8.0 beta and I saw that it also works with 4.7.4.

  17. #17
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    10
    Thanked 13 Times in 12 Posts

    Default Re: Problems when running "configure -static" for 4.7.3

    You Are always welcome..

Similar Threads

  1. Running example project with mingw gives "... exited with code -1073741792" error
    By sibercekirge in forum Installation and Deployment
    Replies: 8
    Last Post: 31st May 2011, 17:33
  2. Replies: 5
    Last Post: 30th January 2010, 19:26
  3. Replies: 2
    Last Post: 7th September 2009, 21:13
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. Replies: 5
    Last Post: 17th January 2008, 21:49

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.