Results 1 to 4 of 4

Thread: Problem Compiling - "`QtValidLicenseForCoreModule"?

  1. #1
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Unhappy Problem Compiling - "`QtValidLicenseForCoreModule"?

    Hello - I'm trying an exercise using 4.3.0, Open Source, on WinXP.

    I've downloaded the Qt code, ran configure and accepted the license. Still, when I try and compile the application I get the following output:

    mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory `C:/projects/primecalc'
    g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_
    THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\Qt\4.3.0\include\QtCore" -I"..\..\Qt\4.3.0\include\QtCore" -I"..\..\Qt\4.3.0\in
    clude\QtGui" -I"..\..\Qt\4.3.0\include\QtGui" -I"..\..\Qt\4.3.0\include" -I"." -I"..\..\Qt\4.3.0\include\ActiveQt" -I"de
    bug" -I"." -I"..\..\Qt\4.3.0\mkspecs\win32-g++" -o debug\main.o main.cpp
    In file included from ../../Qt/4.3.0/include/QtCore/qcoreevent.h:1,
    from ../../Qt/4.3.0/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:28,
    from ../../Qt/4.3.0/include/QtCore/qcoreapplication.h:1,
    from ../../Qt/4.3.0/include/QtGui/../../src/gui/kernel/qapplication.h:27,
    from ../../Qt/4.3.0/include/QtGui/qapplication.h:1,
    from ../../Qt/4.3.0/include/QtGui/QApplication:1,
    from main.cpp:2:
    ../../Qt/4.3.0/include/QtCore/../../src/corelib/kernel/qcoreevent.h:32: error: `QtValidLicenseForCoreModule' does not na
    me a type
    mingw32-make[1]: *** [debug\main.o] Error 1
    mingw32-make[1]: Leaving directory `C:/projects/primecalc'
    mingw32-make: *** [debug] Error 2

    I've Googled around to see what could be causing this but everything indicates the problem is related to not having run 'configure'. I've even checked the qconfig.h file to ensure it contains the correct definition: # define QT_EDITION QT_EDITION_OPENSOURCE and it does. Here is the code I am trying to compile - perhaps I've done something wrong...

    main.cpp
    Qt Code:
    1. #include "primedialog.h"
    2. #include <QApplication>
    3.  
    4. int main( int argc, char* argv[] )
    5. {
    6. QApplication app( argc, argv );
    7. PrimeDialog view;
    8. view.show();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 
    primedialog.h
    Qt Code:
    1. #ifndef PRIMEDIALOG_H
    2. #define PRIMEDIALOG_H
    3.  
    4. #include <QWidget>
    5.  
    6. class QLabel;
    7. class QLineEdit;
    8.  
    9. class PrimeDialog : public QWidget
    10. {
    11. Q_OBJECT
    12. public:
    13. PrimeDialog();
    14. ~PrimeDialog();
    15.  
    16. int getFromValue();
    17. int getToValue();
    18.  
    19. private:
    20. QLabel *m_FromLabel;
    21. QLabel *m_ToLabel;
    22. QLabel *m_AnswerLabel;
    23. QLineEdit *m_FromLineEdit;
    24. QLineEdit *m_ToLineEdit;
    25. QLineEdit *m_AnswerLineEdit;
    26. QProgressBar *m_ProgressBar;
    27.  
    28. public slots:
    29. void disableLineEdits();
    30. void enableLineEdits();
    31. void setAnswerLabelValue( QString newValue );
    32. void updateProgressBar( int percentage );
    33.  
    34. }
    35.  
    36. #endif
    To copy to clipboard, switch view to plain text mode 
    primedialog.cpp
    Qt Code:
    1. #include "primedialog.h"
    2.  
    3. #include <QHBoxLayout>
    4. #include <QVBoxLayout>
    5. #include <QLabel>
    6. #include <QLineEdit>
    7. #include <QProgressBar>
    8.  
    9. PrimeDialog::PrimeDialog()
    10. {
    11. m_FromLabel = new QLabel( "From", this );
    12. m_ToLabel = new QLabel( "To", this );
    13. m_AnswerLabel = new QLabel( "Answer", this );
    14. m_FromLineEdit = new QLineEdit( this );
    15. m_ToLineEdit = new QLineEdit( this );
    16. m_AnswerLineEdit = new QLineEdit( this );
    17. m_ProgressBar = new QProgressBar( this );
    18.  
    19. QHBoxLayout *fromLayout = new QHBoxLayout;
    20. QHBoxLayout *toLayout = new QHBoxLayout;
    21. QHBoxLayout *answerLayout = new QHBoxLayout;
    22. QHBoxLayout *progressLayout = new QHBoxLayout;
    23.  
    24. fromLayout->addWidget( m_FromLabel );
    25. fromLayout->addWidget( m_FromLineEdit );
    26. toLayout->addWidget( m_ToLabel );
    27. toLayout->addWidget( m_ToLineEdit );
    28. answerLayout->addWidget( m_AnswerLabel );
    29. answerLayout->addWidget( m_AnswerLineEdit );
    30. progressLayout->addWidget( m_ProgressBar );
    31.  
    32. QVBoxLayout *mainLayout = new QVBoxLayout;
    33. mainLayout->addLayout( fromLayout );
    34. mainLayout->addLayout( toLayout );
    35. mainLayout->addLayout( answerLayout );
    36. mainLayout->addLayout( progressLayout );
    37.  
    38. setLayout( mainLayout );
    39. setWindowTitle( "Enter info here" );
    40. setFixedHeight( sizeHint().height() );
    41. }
    42.  
    43. int PrimeDialog::getFromValue()
    44. {
    45. return m_FromLineEdit->text().toInt();
    46. }
    47.  
    48. int PrimeDialog::getToValue()
    49. {
    50. return m_ToLineEdit->text().toInt();
    51. }
    52.  
    53. void PrimeDialog::disableLineEdits()
    54. {
    55. m_FromLineEdit->setReadOnly( true );
    56. m_ToLineEdit->setReadOnly( true );
    57. }
    58.  
    59. void PrimeDialog::enableLineEdits()
    60. {
    61. m_FromLineEdit->setReadOnly( false );
    62. m_ToLineEdit->setReadOnly( false );
    63. }
    64.  
    65. void PrimeDialog::setAnswerLabelValue( QString newValue )
    66. {
    67. m_AnswerLineEdit->setText( newValue );
    68. }
    69.  
    70. void PrimeDialog::updateProgressBar( int percentage )
    71. {
    72. //TODO:
    73. }
    To copy to clipboard, switch view to plain text mode 
    As always, any suggestions as to how I could resolve this are greatly appreciated. I have compiled the Qt source (main and debug) without issue, and have even compiled another small application without a problem. I'm hoping I've missed something here.

    Jimmy
    Last edited by Jimmy2775; 6th August 2007 at 01:37. Reason: Noted which platform I'm using.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem Compiling - "`QtValidLicenseForCoreModule"?

    It is the include order from main.cpp.
    QApplication.h has to be first always( even before precompiled headers ).

    Regards

  3. The following user says thank you to marcel for this useful post:

    Jimmy2775 (6th August 2007)

  4. #3
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem Compiling - "`QtValidLicenseForCoreModule"?

    Not the most intuitive error message, I must say, but that has resolved that particular issue. Thanks Marcel.

    I've put the QApplication include at the top of main.cpp, but now I get the following compiler error:

    mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory `C:/projects/primecalc'
    g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_
    THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\Qt\4.3.0\include\QtCore" -I"..\..\Qt\4.3.0\include\QtCore" -I"..\..\Qt\4.3.0\in
    clude\QtGui" -I"..\..\Qt\4.3.0\include\QtGui" -I"..\..\Qt\4.3.0\include" -I"." -I"..\..\Qt\4.3.0\include\ActiveQt" -I"de
    bug" -I"." -I"..\..\Qt\4.3.0\mkspecs\win32-g++" -o debug\main.o main.cpp
    main.cpp:5: error: new types may not be defined in a return type
    main.cpp:5: error: extraneous `int' ignored
    main.cpp: In function `PrimeDialog qMain(int, char**)':
    main.cpp:9: error: conversion from `int' to non-scalar type `PrimeDialog' requested
    mingw32-make[1]: *** [debug\main.o] Error 1
    mingw32-make[1]: Leaving directory `C:/projects/primecalc'
    mingw32-make: *** [debug] Error 2

    Once again, any ideas are appreciated. I don't see how I'm trying to convert an int to my PrimeDialog class.

    Jimmy

  5. #4
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem Compiling - "`QtValidLicenseForCoreModule"?

    Ahhh yes - forgot the ; at the end of the header file.

Similar Threads

  1. Replies: 7
    Last Post: 28th June 2007, 17:18
  2. Replies: 3
    Last Post: 18th April 2007, 15:31
  3. Replies: 7
    Last Post: 1st August 2006, 21:15
  4. Replies: 10
    Last Post: 28th April 2006, 15:48
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.