Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Cannot link statically with MSVC2008.
Forum Updated to NodeBB v4.3 + New Features

Cannot link statically with MSVC2008.

Scheduled Pinned Locked Moved Qt Creator and other tools
21 Posts 4 Posters 8.2k 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.
  • P Offline
    P Offline
    pelig
    wrote on last edited by
    #6

    Hmm, OK. But there are alot of .LIB files as well in the SDK I've installed. Why can't I use them?
    I even tried to remove the DLLs, hoping the linker should take the LIBs instead. But no...

    (BTW, I'm currently building Qt static as koahnig suggested, it has already taken 5-6 hours in my Virtual VMWare Windows 7 and is not ready yet...)

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #7

      In Windows, for each .dll you need a corresponding stub .lib for linking. The .lib files in the SDK download are not static libraries!

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pelig
        wrote on last edited by
        #8

        OK, that explains why I can't use them as static libs...

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #9

          Oh, and be aware of license implications when using static libs!

          If you use the (L)GPL version of Qt, it's most likely that you need to release the source code of your application under GPL too (I'm not a lawyer, so do your own research beforehand!). If you do not want to release your source code, you will be in need of a commercial license.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pelig
            wrote on last edited by
            #10

            Another thing. My compilation of Qt became so big I ran out of disk... :-(
            I will create a new VM with bigger disk and start over.
            My question is, if I compile Qt 4.7.4 do I need the SDK at all? Or do I get "my own" SDK when I build Qt?

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #11

              The SDK consists of the Qt libs itself ("Qt") and additional tools, like Qt Creator, a free toolchain (MinGW) - if you choose that.

              So, basically no, you do not necessarily need the SDK. Qt Designer, Assistant, Linguist, etc. are part of the libs. Qt Creator can be downloaded separately.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • P Offline
                P Offline
                pelig
                wrote on last edited by
                #12

                So I get all I need (static libs and MSVC2008 tool chain) from compiling Qt 4.7.4, except Qt Creator?
                BTW is "Qt lib" & just "Qt" the same thing?

                Sorry for newbie questions... :-)

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #13

                  Yes and yes :-)

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    pelig
                    wrote on last edited by
                    #14

                    I've built Qt (lib), installed Qt Creator, and when I try to build my application it cannot find the Windows SDK LIB-files. I can see them in the file system (But Qt cannot). What is the best way to add LIB path? In my .pro-file, in the mkspec-file or declare an environment variable?

                    Or should I try to make Qt Creator run the MSVC2008 vcvarsall.bat setup file?

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      pelig
                      wrote on last edited by
                      #15

                      My mistake! I had the MinGW tool chain specified, should be MSVC2008...
                      Now my exe file is 13 MB instead of the 35 kB it was when I linked it dynamically. 13 MB sure sounds as if I have built-in the static libs which was my goal!
                      But when I try to run it on a machine where Qt is not installed, I get "The application has failed to start because its side-by-side configuration is incorrect..."
                      Maybe my build was unsuccessful after all?

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        giesbert
                        wrote on last edited by
                        #16

                        Then perhaps the VC redist are missing.
                        I'm not 100% sure, how to link them statically.
                        This is msvcrt*.dll etc which is installed inside the windows directory in SxS

                        Nokia Certified Qt Specialist.
                        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          pelig
                          wrote on last edited by
                          #17

                          I have VC redist installed...

                          1 Reply Last reply
                          0
                          • P Offline
                            P Offline
                            pelig
                            wrote on last edited by
                            #18

                            But it does seem to have something to do with the redist. The Event Log says (dummyTest.exe is my program...)
                            Activation context generation failed for "D:\tools\qttests\test1\dummyTest.exe". Dependent Assembly Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis

                            So I unistalled the VC redist, rebooted, and installed the VC redist again. Same fault. And the version 9.0.21022.8 from the log post matches exactly the redist version. What else is there to do?

                            1 Reply Last reply
                            0
                            • G Offline
                              G Offline
                              giesbert
                              wrote on last edited by
                              #19

                              which version of redist?
                              debug redist are never installed!
                              use the release build on that machine and it should work.
                              Debug versions are never meant for distribution...

                              Nokia Certified Qt Specialist.
                              Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                              1 Reply Last reply
                              0
                              • P Offline
                                P Offline
                                pelig
                                wrote on last edited by
                                #20

                                THANK YOU!
                                As you say (Gerolf) I made a Debug build, but with a Release build I can run it on another machine than the one I built on.
                                Thanx again! Now I'm happy :-)

                                1 Reply Last reply
                                0
                                • G Offline
                                  G Offline
                                  goetz
                                  wrote on last edited by
                                  #21

                                  [quote author="Gerolf" date="1320747501"]which version of redist?
                                  debug redist are never installed!
                                  use the release build on that machine and it should work.
                                  Debug versions are never meant for distribution...[/quote]

                                  Not only that they are not meant for distribution, but Microsoft does not allow you to do so!

                                  http://www.catb.org/~esr/faqs/smart-questions.html

                                  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