Thread: Qt

  1. #1
    Unregistered
    Guest

    Angry Qt

    I'm compiling a QT app the first 1 in the tutorial, I keep getting linker errors (different every time. QT was installed from RPM with my distro and all the include files are in usr/include/qt so the install should be OK.

    the command Im typing is:
    > g++ hiworld.cpp -o world

    do I need to add anything to the command? some object files or something?

    What else could be the problem?

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    9

    Cool QT linking

    There are almost certainly library files
    that you have to link in on the compile command line. By default, only the standard C library is included. So, to include a specific extra library, the compile command needs -l (lowercase "L" not the digit) and a few letters to tell the name of the library. For example, -lm means include the math library. Check your docs for the reference to the library for QuickTime -- I bet it's -lqt or something like that. You may need other libraries too, such as -lm -lz. Check the QT docs.....

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    2
    The way you know what the -l switches are is the name of the library minus "lib" at the beginning and the suffixes. F'r instance, the math library is libm.so.whatever so you use -lm; if you want libjpeg6a.so.blabla you would use the switch -ljpeg6a and so on.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. QT 4 and MSVC 6.0. Need help/
    By LMZ in forum C++ Programming
    Replies: 1
    Last Post: 09-15-2006, 03:57 PM
  2. C & QT Question
    By DaveHope in forum Linux Programming
    Replies: 4
    Last Post: 12-22-2003, 01:32 PM
  3. QT or others for the beginning linux programmer
    By FillYourBrain in forum Linux Programming
    Replies: 3
    Last Post: 09-12-2003, 01:17 PM
  4. problems with my first attempt at a Qt application...
    By Captain Penguin in forum C++ Programming
    Replies: 0
    Last Post: 10-01-2002, 09:14 PM
  5. First QT App
    By Troll_King in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 07-26-2002, 09:30 AM