Results 1 to 4 of 4

Thread: Reopening an old file- "C++ does not support default-int"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,327
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Reopening an old file- "C++ does not support default-int"

    I was wondering if there was some Qt configuration option I messed up
    No, the error message says it all: C++ does not support default int. All functions must have their return types declared. There is no return type declared for WriteFile. If this worked at some time in the past, it was probably because the C++ compiler you were using at the time was not compliant to the C++ standard.

    This error has noting to do with Qt or your Qt configuration. It's a compile-time error in -your- code.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. #2
    Join Date
    Dec 2016
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Reopening an old file- "C++ does not support default-int"

    Okay, yes, nevermind. I messed up my test case because I forgot to include the header file so it never compiled and it gave me the same error when included. I don't know how my compiler difference made a difference when that standard was implemented in 2005. I guess I'll have to go through and add void return types to all my functions. Thanks.

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,327
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Reopening an old file- "C++ does not support default-int"

    As far as I know, the C language uses "int" as the default return type for functions where a return type is not declared. Since most C++ compilers are written to also compile C, some of them allowed this for C++ methods even though it was not compliant with the standard. I do not know when Microsoft made their compilers compliant with this part of the standard - probably after Stan Lippman joined in 2001.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Default QFileDialog to "This PC" or "My Computer"
    By JayKemper in forum Qt Programming
    Replies: 1
    Last Post: 18th June 2015, 22:12
  2. Replies: 1
    Last Post: 15th June 2010, 06:49
  3. Replies: 3
    Last Post: 15th February 2010, 17:27
  4. Replies: 3
    Last Post: 8th July 2008, 19:37
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

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.