Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Linking with binary libraries compiled with other MSVC version
Servers for Qt installer are currently down

[Solved] Linking with binary libraries compiled with other MSVC version

Scheduled Pinned Locked Moved General and Desktop
17 Posts 5 Posters 8.0k 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.
  • B Offline
    B Offline
    blex
    wrote on 1 Dec 2010, 10:59 last edited by
    #5

    [quote author="Franzk" date="1291200447"]If the required runtime libraries are installed I wouldn't expect any issues. [/quote]

    Thanks, I will try to find the redistributable package that contains used libraries of correct version.


    Oleksiy Balabay

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on 1 Dec 2010, 13:21 last edited by
      #6

      I don't know if it really works if both runtimes are installed, but it would definitely scare me if I knew my app runs on two different C and C++ runtimes at the same time.

      For Visual Studio 2005 there are actually to versions: the original VS2005 and VS2005 Service Pack 1 (SP1). Binaries built with SP1 don't run with orignial VS2005 libs. I don't know exactly if that is true for the other way round, too.

      The easiest way to get around these issues would be to use the exactly the same compiler version that the libs/DLLs are built with (of course only if you happen to own the respective version.... which might be a problem).

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

      1 Reply Last reply
      0
      • B Offline
        B Offline
        blex
        wrote on 1 Dec 2010, 15:54 last edited by
        #7

        Thanks, Volker.

        As far as I know the libs are different for MSVC2005 Express Edition and MSVC2005 Team Edition


        Oleksiy Balabay

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on 1 Dec 2010, 16:00 last edited by
          #8

          From an ABI (Application Binary Interface) view this should not make any difference. It's more a question of SP1 or not. I once got bitten by this when I used the precompiled libs that the Trolls provide; these were built with VS2005+SP1, I had no SP1 installed (and could not upgrade for some reason). I could not link my application against these DLLs and went off to compile Qt by hand, so that they depend on the very same libs and version my installation provided.

          I know, all this is a big nightmare :-(

          If you can grab the sources of the lib you use, it would be best to compile it yourself.

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

          1 Reply Last reply
          0
          • B Offline
            B Offline
            blex
            wrote on 1 Dec 2010, 16:14 last edited by
            #9

            [quote author="Volker" date="1291219256"]If you can grab the sources of the lib you use, it would be best to compile it yourself.[/quote]

            Unfortunately, it's impossible. Thank you for explanation.


            Oleksiy Balabay

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on 1 Dec 2010, 16:22 last edited by
              #10

              No problem, you're welcome. We've now ended with three virtual machines, one for VS2005 without SP1, one for VS2005+SP1 and one for VS2008 each. That's only to separate from the different dependencies.

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

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DenisKormalev
                wrote on 1 Dec 2010, 17:07 last edited by
                #11

                yes, Volker is right about SP1 and it can be a root of problem I think.

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  blex
                  wrote on 1 Dec 2010, 17:09 last edited by
                  #12

                  [quote author="Denis Kormalev" date="1291223254"]yes, Volker is right about SP1 and it can be a root of problem I think.[/quote]

                  I am recompiling now and will report about result to compete the topic.


                  Oleksiy Balabay

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    blex
                    wrote on 2 Dec 2010, 08:55 last edited by
                    #13

                    Yes, the SP1 was a root of the problem.

                    Thanks all for assistance.


                    Oleksiy Balabay

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      razvanpetru
                      wrote on 2 Dec 2010, 09:29 last edited by
                      #14

                      Linking is safe (fails at build time), the painful part comes when you use the library and when deploying. Definitely not a recommended thing to do.

                      1 Reply Last reply
                      0
                      • B Offline
                        B Offline
                        blex
                        wrote on 2 Dec 2010, 09:42 last edited by
                        #15

                        [quote author="razvanpetru" date="1291282169"]Linking is safe (fails at build time), the painful part comes when you use the library and when deploying. Definitely not a recommended thing to do.[/quote]

                        When I install service pack then the used library is the same. Thank you for recommendation.


                        Oleksiy Balabay

                        1 Reply Last reply
                        0
                        • G Offline
                          G Offline
                          goetz
                          wrote on 2 Dec 2010, 11:45 last edited by
                          #16

                          You must install both runtimes (MSVCRT, MSVCP) on the target machine. There are installers from Microsoft for that (vcredist exe or an MSI include); you must execute both .exe or include both MSI snippets.

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

                          1 Reply Last reply
                          0
                          • B Offline
                            B Offline
                            blex
                            wrote on 2 Dec 2010, 11:50 last edited by
                            #17

                            [quote author="Volker" date="1291290350"]You must install both runtimes (MSVCRT, MSVCP) on the target machine. There are installers from Microsoft for that (vcredist exe or an MSI include); you must execute both .exe or include both MSI snippets.[/quote]

                            Thanks. It seems that I can eliminate library without SP1.


                            Oleksiy Balabay

                            1 Reply Last reply
                            0

                            14/17

                            2 Dec 2010, 09:29

                            • Login

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