Results 1 to 6 of 6

Thread: quint16 compiling problem

  1. #1
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Question quint16 compiling problem

    Hello!

    Here is code:
    Qt Code:
    1. // globals.h
    2.  
    3. #ifndef GLOBALS_H
    4. #define GLOBALS_H
    5.  
    6. // qt includes
    7. #include <QtGlobal>
    8.  
    9. // scene rect coords
    10. static const unsigned quint16 minX=0;
    11. static const unsigned quint16 minY=0;
    12. static const unsigned quint16 maxX=400;
    13. static const unsigned quint16 maxY=400;
    14.  
    15. #endif
    To copy to clipboard, switch view to plain text mode 
    I've added globals.h into .pro file and then i run
    Qt Code:
    1. qmake
    To copy to clipboard, switch view to plain text mode 
    and after
    Qt Code:
    1. make
    To copy to clipboard, switch view to plain text mode 
    I get following errors:
    Qt Code:
    1. mingw32-make -f Makefile.Debug
    2. mingw32-make[1]: Entering directory `C:/DOCUME~1/markofr/WORKSP~1/eROS'
    3. c:\Qt\4.3.2\bin\uic.exe crosmainwindow.ui -o ui_crosmainwindow.h
    4. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
    5. DQT_DLL -DQT_SVG_LIB -DQT_SQL_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB
    6. -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\4.3.2\inclu
    7. de\QtCore" -I"..\..\..\..\Qt\4.3.2\include\QtCore" -I"..\..\..\..\Qt\4.3.2\inclu
    8. de\QtNetwork" -I"..\..\..\..\Qt\4.3.2\include\QtNetwork" -I"..\..\..\..\Qt\4.3.2
    9. \include\QtGui" -I"..\..\..\..\Qt\4.3.2\include\QtGui" -I"..\..\..\..\Qt\4.3.2\i
    10. nclude\QtOpenGL" -I"..\..\..\..\Qt\4.3.2\include\QtOpenGL" -I"..\..\..\..\Qt\4.3
    11. .2\include\QtSql" -I"..\..\..\..\Qt\4.3.2\include\QtSql" -I"..\..\..\..\Qt\4.3.2
    12. \include\QtSvg" -I"..\..\..\..\Qt\4.3.2\include\QtSvg" -I"..\..\..\..\Qt\4.3.2\i
    13. nclude" -I"c:\Qt\4.3.2\include\ActiveQt" -I"debug" -I"." -I"..\..\..\..\Qt\4.3.2
    14. \mkspecs\win32-g++" -o debug\CMerchandizeSelector.o CMerchandizeSelector.cpp
    15. In file included from CMerchandizeSelector.h:13,
    16. from CMerchandizeSelector.cpp:1:
    17. globals.h:10: error: `quint16' does not name a type
    18. globals.h:11: error: `quint16' does not name a type
    19. globals.h:12: error: `quint16' does not name a type
    20. globals.h:13: error: `quint16' does not name a type
    21. CMerchandizeSelector.cpp: In constructor `CMerchandizeSelector::CMerchandizeSele
    22. ctor(QWidget*)':
    23. CMerchandizeSelector.cpp:8: error: `minX' undeclared (first use this function)
    24. CMerchandizeSelector.cpp:8: error: (Each undeclared identifier is reported only
    25. once for each function it appears in.)
    26. CMerchandizeSelector.cpp:8: error: `minY' undeclared (first use this function)
    27. CMerchandizeSelector.cpp:8: error: `maxX' undeclared (first use this function)
    28. CMerchandizeSelector.cpp:8: error: `maxY' undeclared (first use this function)
    29. mingw32-make[1]: *** [debug\CMerchandizeSelector.o] Error 1
    30. mingw32-make[1]: Leaving directory `C:/DOCUME~1/markofr/WORKSP~1/eROS'
    31. mingw32-make: *** [debug] Error 2
    32.  
    33. C:\DOCUME~1\markofr\WORKSP~1\eROS>
    To copy to clipboard, switch view to plain text mode 
    It's obviously quint16 type is not recognized. Why??
    Qt 5.3 Opensource & Creator 3.1.2

  2. #2
    Join Date
    Jan 2007
    Posts
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: quint16 compiling problem

    According to the documentation quint16 is a typedef for "unsigned short". Could it be that with your code this then leads e.g. to "static const unsigned unsigned short minX=0;"?

    Happy coding

  3. #3
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: quint16 compiling problem

    I know, but unsigned int IS NOT platofrm independent, quint16 IS PLATFORM INDEPENDENT on all supported platform, so I cannot use ordinary int.
    Qt 5.3 Opensource & Creator 3.1.2

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: quint16 compiling problem

    He meant that it should be "static const quint16" not "static const unsigned quint16".
    J-P Nurmi

  5. #5
    Join Date
    Jan 2007
    Posts
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: quint16 compiling problem

    Exactly, thats what I've meant. Sorry if my answer wasn't clear enough.
    Last edited by flare; 30th November 2007 at 20:40.

  6. #6
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: quint16 compiling problem

    Dzizus, thanks man!!!!!! What a stupid idiot mistake!!!!!!!!!!!!
    Qt 5.3 Opensource & Creator 3.1.2

Similar Threads

  1. Problem compiling ibase driver
    By SteM in forum Installation and Deployment
    Replies: 12
    Last Post: 24th September 2007, 22:26
  2. Replies: 7
    Last Post: 28th June 2007, 17:18
  3. Replies: 7
    Last Post: 1st August 2006, 21:15
  4. Replies: 10
    Last Post: 28th April 2006, 15:48
  5. quint16 problem !!!
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 22nd March 2006, 22:35

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.