Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Problems Compiling QML app in Visual Studio

Problems Compiling QML app in Visual Studio

Scheduled Pinned Locked Moved QML and Qt Quick
27 Posts 5 Posters 22.7k 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.
  • K Offline
    K Offline
    kyleplattner
    wrote on last edited by
    #1

    I am able to run the program fine if I run it out of Visual Studio (except the fonts change), but when I go into the release or debug folder and try to run the .exe file without Visual Studio I get an error:

    The program can't start because QtDeclarative4.dll is missing from your computer. Try reinstalling the program to fix this problem.

    Any ideas?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      You should put this library near your .exe or put path to folder with it in PATH env variable.

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

        You must copy QtDeclarative4.dll (and at least QtCore4.dll and QtGui4.dll and probably some others) to the release folder.

        You can use depends.exe downloadable from http://www.dependencywalker.com/ to find out which DLLs are needed by your application and by the DLLs that it needs.

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

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kyleplattner
          wrote on last edited by
          #4

          Where can I find the .dll files I need?

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

            It's in the bin folder of your Qt installation.

            Since you're using MSVS they are probably in C:\Qt\insert-your-version\bin

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

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

              If you are using the debug build, you should link against the debug libraries: QtCored4.dll and QtGuid4.dll and QtDeclaratived4.dll

              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
              • K Offline
                K Offline
                kyleplattner
                wrote on last edited by
                #7

                Forgive my newbie questions but how do I go about linking those files in Visual Studio 2008?

                Also any ideas for how to get the fonts to look the same as they do where I developed them in OS X?

                1 Reply Last reply
                0
                • X Offline
                  X Offline
                  xsacha
                  wrote on last edited by
                  #8

                  Perhaps we need a wiki about libraries being in PATH or including them with the app in a redistributable form.

                  As for the fonts: Qt tries to use system font by default (to give native look among other things). This includes font face, size and (quite importantly) anti-aliasing.
                  If you want to override the system font, you should pick the font you want to use manually in your application. If you've already done this, you might be referring to anti-aliasing then?

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

                    I have picked the font manually in QML. Arial Bold for everything, but every font appears about 2x the size in the windows exe.

                    1 Reply Last reply
                    0
                    • X Offline
                      X Offline
                      xsacha
                      wrote on last edited by
                      #10

                      Have you changed "font.pixelSize":http://doc.qt.nokia.com/latest/qml-textinput.html#font.pixelSize-prop or "font.pointSize":http://doc.qt.nokia.com/latest/qml-textinput.html#font.pointSize-prop for your elements?

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

                        font.pixelSize, do you I have to go through and change them all?

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          kyleplattner
                          wrote on last edited by
                          #12

                          I fixed the font issue but I am still having problems running the .exe. I put all the .dll files in the release folder and now when I run the .exe I get a blank window. Any ideas?

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

                            Could be it does not find you .qml file?

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

                            1 Reply Last reply
                            0
                            • K Offline
                              K Offline
                              kyleplattner
                              wrote on last edited by
                              #14

                              I don't think so, it still works great if I run it through Visual Studio, it only gives me the blank window when I try to run the .exe straight from the release folder. Very frustrating.

                              1 Reply Last reply
                              0
                              • D Offline
                                D Offline
                                DenisKormalev
                                wrote on last edited by
                                #15

                                kyleplattner, where does you qml located? if you just have it in sources and use relative path to it when you should check that this relative paths are ok relatively to exe file.

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

                                  Then probably something else is not found. Unfortunately I never created a QML app on windows, so I can't help further.

                                  If you don't mind, you could provide a ZIP with a complete sample of your code, so we could test it on our machines.

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

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

                                    All of my QML files are in the same directory as my main.cpp along with the release and debug folders.

                                    1 Reply Last reply
                                    0
                                    • D Offline
                                      D Offline
                                      DenisKormalev
                                      wrote on last edited by
                                      #18

                                      kyleplattner, place them in one folder with .exe.

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

                                        Dennis, I followed your advice and it worked. Everything is in the same folder and it runs. Now how can I send the .exe off to management and get it to run on their machines.

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

                                          Or, better, embed it in a resource file (.qrc).

                                          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