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. [Help] How to set up the Qt include\Library path for Visual Studio 2010
Forum Updated to NodeBB v4.3 + New Features

[Help] How to set up the Qt include\Library path for Visual Studio 2010

Scheduled Pinned Locked Moved General and Desktop
23 Posts 7 Posters 50.8k 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
    kusanagirong
    wrote on 29 Sept 2010, 21:00 last edited by
    #1

    Hi guys,

    I am pretty new to QT, I am wondering any1 here can get Qt SDK compiled by using Visual Studio 2010 express (VS2010Exp)?
    This what I did:

    • I downloaded the SDK package, installed it.

    • Create a new empty project in VS2010Exp and a cpp file including simple code.

    • Set up the include files path: added c:\Qt\2010.5.10\qt\Include and c:\Qt\2010.5.10\qt\Include

    • Set up the Library files path: added c:\Qt\2010.5.10\qt\Bin and c:\Qt\2010.5.10\qt\Bin. I also tried to add "c:\Qt\2010.5.10\qt\lib" and "c:\Qt\2010.5.10\lib".

    After that, I tried to compile the project, but I got LINK error which says that the compiler cant find Qt function definitions. As far as I see, the problem is the Library file including.

    So my question is how can I correctly set up the including files (Include/Library) path?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      anselmolsm
      wrote on 29 Sept 2010, 21:23 last edited by
      #2

      [quote author="kusanagirong" date="1285794026"]Hi guys,

      • Set up the Library files path: added c:\Qt\2010.5.10\qt\Bin and c:\Qt\2010.5.10\qt\Bin
        [/quote]

      I guess the lib path should be something like c:\Qt\2010.5.10\qt\lib - I don't have a Windows setup to confirm it right now, but the path probably looks like that.

      Anselmo L. S. Melo (anselmolsm)

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Felix
        wrote on 29 Sept 2010, 21:23 last edited by
        #3

        First of all I would suggest you to use QtCreator. It makes all things with Qt pretty easy. (AFAIK it is included in the SDK)

        Did you create a new c++ project in Visual Studio?
        If you did so Qt requires .pro files "as explained here":http://doc.qt.nokia.com/4.7/qmake-project-files.html . You can then use qmake with parameter -tp vc to create a Visual Studio project. This has all required qt Libraries added aswell as all of the other stuff you wrote in your .pro file.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kusanagirong
          wrote on 29 Sept 2010, 21:29 last edited by
          #4

          anselmolsm wrote:
          I guess the lib path should be something like c:\Qt\2010.5.10\qt\lib – I don’t have a Windows setup to confirm it right now, but the path probably looks like that.

          Sorry, I forgot to mention that I also tried include " c:\Qt\2010.5.10\qt\lib" and "c:\Qt\2010.5.10\lib" too, but it still does work :p

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kusanagirong
            wrote on 29 Sept 2010, 21:29 last edited by
            #5

            Hi Felix,

            Thanks for your reply, I will try it later. But according to your suggestion I got another question about creator. Is it a IDE just for Qt or I can easily use any other API in it? And is it got a nice debug tools like VS 2010 exp. Since I am trying to add a GUI to an OpenGL application. I am not sure the creator is handy or not for this task.

            Cheers!

            1 Reply Last reply
            0
            • S Offline
              S Offline
              steno
              wrote on 29 Sept 2010, 22:48 last edited by
              #6

              Don't use creator if you have Visual studio. Visual studio is a much more powerful tool than creator. An easy way to setup include paths and library paths is to install the Qt visual studio add in.

              "Visual studio add in.":http://qt.nokia.com/downloads/visual-studio-add-in

              Plus, hard coding those paths isn't such a good idea other. Look into setting up system variables. I use QTDIR. Then all you have to do in visual studio is $(QTDIR)\lib and $(QTDIR)\include.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kusanagirong
                wrote on 30 Sept 2010, 03:16 last edited by
                #7

                Thanks for your reply steno. I think VS is cool :)

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  tobias.hunger
                  wrote on 30 Sept 2010, 08:28 last edited by
                  #8

                  If it is a LINK error then it definitely is not about include pathes since the linked does not care at all about header files.

                  Check the library include pathes instead.

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    pushpendrak
                    wrote on 1 Oct 2010, 10:17 last edited by
                    #9

                    I want to ask kusanagirong: if u compiled properly

                    1). open command prompt from VS2010
                    2). Run configure.exe after changing to QT sdk dir
                    3). after successful configure run "nmake -f"

                    it will create the libraries for VS2010 compatible and debug files. it also convert your Qt Examples and demo projects to VS project.

                    this process is very lengthy and takes hours to compile.
                    but u can compile project from QtCreator only by setting Qt Qmake path.
                    as qt plugin cannot be installed on a VS2010 Exp edition.

                    there is custom compilation of Qt project in VS (like MOC, UIC etc.) which requires Qt plugin, only possible in VS pro/team/ultimate etc not in Express ed.

                    PushpendraK

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      tobias.hunger
                      wrote on 1 Oct 2010, 10:26 last edited by
                      #10

                      kusanagirong: Give Qt Creator a try:-) I absolutely prefer it to visual studio ...

                      1 Reply Last reply
                      0
                      • ? This user is from outside of this forum
                        ? This user is from outside of this forum
                        Guest
                        wrote on 1 Oct 2010, 11:03 last edited by
                        #11

                        [quote author="Tobias Hunger" date="1285928770"]kusanagirong: Give Qt Creator a try:-) I absolutely prefer it to visual studio ...[/quote]

                        ditto :)

                        1 Reply Last reply
                        0
                        • F Offline
                          F Offline
                          Felix
                          wrote on 1 Oct 2010, 11:52 last edited by
                          #12

                          i also think its best for qt applications

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            steno
                            wrote on 1 Oct 2010, 15:41 last edited by
                            #13

                            bq. Tobias Hunger wrote:
                            kusanagirong: Give Qt Creator a try:-) I absolutely prefer it to visual studio …

                            Lol, you're a troll..... you get paid to say that.

                            1 Reply Last reply
                            0
                            • T Offline
                              T Offline
                              tobias.hunger
                              wrote on 1 Oct 2010, 16:38 last edited by
                              #14

                              steno: No, I am payed to hack on the most awesome IDE there is:-)

                              1 Reply Last reply
                              0
                              • F Offline
                                F Offline
                                Felix
                                wrote on 1 Oct 2010, 17:48 last edited by
                                #15

                                Well im Not a Troll but creator is Best for qt in my opinion

                                1 Reply Last reply
                                0
                                • P Offline
                                  P Offline
                                  pushpendrak
                                  wrote on 1 Oct 2010, 18:44 last edited by
                                  #16

                                  yeah, QT is fast, easy and handy only u've to remember its short keys. and most impotant it is not bloated like vs.

                                  in case of compilation of code MS compiler is fast (also generate the debug info, means if error occurs it through an exception message not in case of mingw. it just close app).

                                  PushpendraK

                                  1 Reply Last reply
                                  0
                                  • T Offline
                                    T Offline
                                    tobias.hunger
                                    wrote on 2 Oct 2010, 16:42 last edited by
                                    #17

                                    pushpendrak: You are aware that you can use the msvc compiler and cdb debugger with creator?

                                    1 Reply Last reply
                                    0
                                    • P Offline
                                      P Offline
                                      pushpendrak
                                      wrote on 3 Oct 2010, 05:31 last edited by
                                      #18

                                      yes i am using it also. it works fine -but is not much helpful. if app crashes it let me know what was the error okey.....

                                      PushpendraK

                                      1 Reply Last reply
                                      0
                                      • T Offline
                                        T Offline
                                        tobias.hunger
                                        wrote on 3 Oct 2010, 06:54 last edited by
                                        #19

                                        pushpendrak: Do you want the debugger to be brought up when an application crashes automatically? That is called "post-mortem debugging" and can be enabled in creator. By default it is off since many people report they find it annoying.

                                        1 Reply Last reply
                                        0
                                        • P Offline
                                          P Offline
                                          pushpendrak
                                          wrote on 3 Oct 2010, 14:55 last edited by
                                          #20

                                          yes it is there, but when i m app is coming into creator it shows only assembly, what i'll do with that?
                                          not of any use.

                                          like as in vs it produces program database (.pdb) which will trace it to exact line in code.

                                          PushpendraK

                                          1 Reply Last reply
                                          0

                                          1/23

                                          29 Sept 2010, 21:00

                                          • Login

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