Results 1 to 9 of 9

Thread: VC++ 2008 compile error

  1. #1
    Join Date
    Jul 2008
    Location
    Philippines
    Posts
    60
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question VC++ 2008 compile error

    hi folks, im new to VC++ programming with QT. I'm using Visual Studio 2008, Opensource Qt 4.5.3 and Qt4 Visual Studio Add In 1.1.1. I've created a new Qt4 application project and try to compile it, but during compilation i got this error:

    LINK : fatal error LNK1181: cannot open input file 'qtmain.lib'
    could anyone help me to fix this error? thnks

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: VC++ 2008 compile error

    technically, that is not an error in the compilation stage, but rather in the linking stage.
    Do you know where this 'qtmain.lib' exists?
    VS has a problem opening or locating the said library.
    Did you perhaps forget to tell VS where it can find this library?

    There might be a good reason why you are using VS, but if you are just starting with C++ and Qt, you might be better off using Qt Creator. That way it is easier to try out Qt examples.

    Something like this might be a good read:
    http://www.cs.duke.edu/~ola/book/compiling.html

    Once you master that, I would recommend diving into Qt's excellent online documentation:
    http://doc.qt.nokia.com/4.6/how-to-learn-qt.html

    There is a reference to an online book on the above page if you prefer more guided approach.

    good luck
    Last edited by schnitzel; 2nd December 2009 at 03:49. Reason: updated contents

  3. #3
    Join Date
    Jul 2008
    Location
    Philippines
    Posts
    60
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: VC++ 2008 compile error

    Do you know where this 'qtmain.lib' exists?
    no, i have searched the Qt install directory but i can't find it. All i found are the .a's files under the lib folder.

    There might be a good reason why you are using VS,
    yes, you're right. i'm currently trying to convert a program to qt, it is created using visual c++.

    but if you are just starting with C++ and Qt, you might be better off using Qt Creator. That way it is easier to try out Qt examples.
    actually, i'm no longer a qt beginner, i've already created programs using Qt Creator and QDevelop. Now, i'm trying to use and learn Visual C++ with Qt.

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: VC++ 2008 compile error

    Did you recompile Qt to support Visual Studio? Otherwise no .lib files exist, only .a files. Once you rebuild Qt using Visual studios compiler, there will be .lib files.

  5. #5
    Join Date
    Jul 2008
    Location
    Philippines
    Posts
    60
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: VC++ 2008 compile error

    Did you recompile Qt to support Visual Studio?
    not yet, how can i recompile it to support VS?

  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: VC++ 2008 compile error

    You need to run 'configure' from a dos prompt.

    Eg.

    configure -platform win32-msvc2008

    and then build the libraries using nmake

    This can easily take 4 hours or more, so be patient.

  7. #7
    Join Date
    Jul 2008
    Location
    Philippines
    Posts
    60
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: VC++ 2008 compile error

    thnks, so i have to configure Qt first...

  8. #8
    Join Date
    Dec 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: VC++ 2008 compile error

    "and Qt4 Visual Studio Add In 1.1.1" <-- this should avoid QT compilation, doesn't it?

  9. #9

    Default Re: VC++ 2008 compile error

    Hey, someone discuss a relative topic:How to automatically stop Visual C++ 2008 build at first compile error? , maybe helpful

Similar Threads

  1. Gtk error when installing Qt in linux
    By john_god in forum Installation and Deployment
    Replies: 1
    Last Post: 18th November 2009, 05:08
  2. Qt 4.4.1 Compile Error with MS Visual C++ 2008 Express SP1
    By BrainB0ne in forum Installation and Deployment
    Replies: 3
    Last Post: 19th August 2008, 15:49
  3. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  4. Qtopia core 4.2.2 cross compile make error
    By smiyai18 in forum Installation and Deployment
    Replies: 2
    Last Post: 28th August 2007, 17:04
  5. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19

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.