Results 1 to 3 of 3

Thread: Core headers not found

  1. #1
    Join Date
    Aug 2011
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Core headers not found

    Hi,

    I'm trying to learn the Qt framework as best as I can, and I thought the best course of action for this was to work through the tutorials, one at a time. I originally used the add-in for VS2010 on my first try to compile cpp files meant for Qt. The problem I am always having is that it reports QApplication and QPushbutton, as in the first two includes in the first "Hello world" application on the tutorial, as missing. I searched and found them located in QtGUI. I tried to use them and it resulted in it reporting that the functions were not valid, even going as far as to move the header files into the project directory, nothing. I rebuilt the Qt binaries and made sure all of my build targets were correct, before giving up and getting Qt SDK.

    Now I'm having the same problem in Qt SDK. Build target appears to be correct, it works just fine for Qt Quick applications, but it does not appear to be able to build any files or example projects that I download. Searching for a similar problem is just making me run in circles doing the same things over and over again.

    Here is the code
    Qt Code:
    1. #include <QCoreApplication>
    2. #include <QApplication>
    3. #include <QPushButton>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication app(argc, argv);
    8.  
    9. QPushButton hello("Hello world!");
    10. hello.resize(100, 30);
    11.  
    12. hello.show();
    13. return app.exec();
    14. }
    To copy to clipboard, switch view to plain text mode 

    Putting this into Qt SDK results in it claiming that it can't find QApplication or QtPushButton.

    Changing this to

    Qt Code:
    1. #include <QtGUI\QApplication>
    2. #include <QtGUI\QPushButton>
    To copy to clipboard, switch view to plain text mode 

    Removes the problem, but now it claims that the function is invalid, or at least that's what I think it is saying.

    Qt Code:
    1. D:\Qt\test\main.cpp:-1: error: undefined reference to `_imp___ZN12QApplicationC1ERiPPcbi'
    2. D:\Qt\test\main.cpp:-1: error: undefined reference to `_imp___ZN11QPushButtonC1ERK7QStringP7QWidget'
    To copy to clipboard, switch view to plain text mode 

    It's likely something very small and very stupid (probably some stupid step I skipped). Any ideas are welcome, assume that I have no idea what I am doing.

  2. #2
    Join Date
    Jul 2011
    Location
    Brasil
    Posts
    39
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Core headers not found

    You don't need to use "QtGui\"...

    Just review your .pro file, and make sure you have a line like:
    Qt Code:
    1. QT += core gui
    To copy to clipboard, switch view to plain text mode 

    And you should not have a "QT -= core"...

    HTH

  3. #3
    Join Date
    Aug 2011
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Core headers not found

    Still isn't working

    That's the first line inside of it.


    EDIT: Update: I've found that it actually works just fine in Code::Blocks. I am not entirely sure why.
    Last edited by CDRW; 5th August 2011 at 09:10.

Similar Threads

  1. QT Core Library Not Found
    By RyanS09 in forum Newbie
    Replies: 2
    Last Post: 26th April 2011, 09:51
  2. CPU core information
    By bred in forum Qt Programming
    Replies: 1
    Last Post: 2nd December 2010, 17:17
  3. QT core lib performance?
    By Quentin in forum Qt Programming
    Replies: 1
    Last Post: 31st January 2009, 09:17
  4. core dump
    By DadaLee in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 16th September 2008, 10:05
  5. app core dumps!!
    By Seema Rao in forum Qt Programming
    Replies: 6
    Last Post: 3rd May 2006, 12:36

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.