Results 1 to 10 of 10

Thread: Terrible unidentified problem!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Angry Terrible unidentified problem!

    Hello!

    Something strange happened with my software.

    I was editing it quite normally, everything running fine, when in the last rebuild, two message errors appeared, showing problems in files that I simply didn't touch!

    To give an idea, one of the problems say "/home/martin/Documentos/Programas Qt/M/mClock/../../../../QtSDK/Desktop/Qt/473/gcc/include/QtGui/qcalendarwidget.h:52: error: expected initializer before ‘typedef’"

    But QCalendarWidget is simply called by the software in order to put a calendar in the MainWindow, while I simply didn't touch in the part regarding it in the software since two weeks!

    Not just that, but the same problem is appointed to one of my classes, while this class, once again, wasn't touch in weeks and was working fine till now! :

    /home/martin/Documentos/Programas Qt/M/mClock/clocksound.h:8: error: expected initializer before ‘class’

    There is simply no problem with it. As I sad, I didn't even touch in this files and now they are reporting problems. My recent edits were all made in a different class, and they were all common changes that I already know how to do (i.e. nothing special or difficult).

    I simply don't know what is happening. Does somebody knows something about? I tried to comment the recent edits, including, and nothing changed.


    Thanks!

  2. #2
    Join Date
    Oct 2010
    Posts
    55
    Thanks
    1
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    9

    Default Re: Terrible unidentified problem!

    Make sure that you don't have a missing semicolon at the end of a class declaration somewhere else in your project.

    Qt Code:
    1. #ifndef MYCLASS_H
    2. #define MYCLASS_H
    3.  
    4. class MyClass
    5. {
    6. public:
    7. // ...
    8.  
    9. } // <-- oops
    10.  
    11. #endif // MYCLASS_H
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Apr 2011
    Posts
    124
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Terrible unidentified problem!

    Yep, a missing semicolon in one of your includes is the most likely cause.

  4. #4
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Terrible unidentified problem!

    Also, of course - if it was working before, undo your recent changes to the point where it was working, and ensure that the problem is somewhere within your code. Assuming you're using a revision control system, this is a quick, simple check.

  5. #5
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Terrible unidentified problem!

    Quote Originally Posted by DanH View Post
    Yep, a missing semicolon in one of your includes is the most likely cause.
    Nops, that's not the problem. I revised class by class and al semicolon are in place.

    Quote Originally Posted by SixDegrees View Post
    Also, of course - if it was working before, undo your recent changes to the point where it was working, and ensure that the problem is somewhere within your code. Assuming you're using a revision control system, this is a quick, simple check.
    I tried to do this. unfortunately, for this software I'm not doing a revision control system (the unique one that I'm not doing it, and the only one with such problem!). But, as I sad, I commented the changes and it was for no good use. Well, I'll try to delete literally everything, let us see what happens.

    Any case, don't somebody have another idea?

  6. #6
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Terrible unidentified problem!

    My money is on a change that you've made, deliberately or not. The story - everything worked, you made some changes, now it doesn't work - is consistent with that and little else. The chances of some file outside your project changing is near zero. So look at your code and scan for errors. Try eliminating ALL include statements and repace external references with forward declarations to narrow the compiler's attention to your own files, which is almost certainly where the problem lies. As others have said, it's probably a misplaced semi-colon, or perhaps a run-on string declaration, but there's some syntactical error there somewhere. The gripes about problems in external files are not the cause; they're a symptom.

    You should have the problem narrowed down to one or two files, a header file and possibly a source file. Delete everything but the include statements; compilation will likely succeed, proving that the problem is in the code you got rid of and not any of the external chaff. Replace your code, incrementally if possible, until the problem is isolated.
    Last edited by SixDegrees; 27th August 2011 at 16:25.

  7. #7
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Terrible unidentified problem!

    Quote Originally Posted by SixDegrees View Post
    My money is on a change that you've made, deliberately or not. The story - everything worked, you made some changes, now it doesn't work - is consistent with that and little else. The chances of some file outside your project changing is near zero. So look at your code and scan for errors. Try eliminating ALL include statements and repace external references with forward declarations to narrow the compiler's attention to your own files, which is almost certainly where the problem lies. As others have said, it's probably a misplaced semi-colon, or perhaps a run-on string declaration, but there's some syntactical error there somewhere. The gripes about problems in external files are not the cause; they're a symptom.

    You should have the problem narrowed down to one or two files, a header file and possibly a source file. Delete everything but the include statements; compilation will likely succeed, proving that the problem is in the code you got rid of and not any of the external chaff. Replace your code, incrementally if possible, until the problem is isolated.
    How, that is trully a technical help xDD

    Anyway, here is what I did: I created a new project and included the same files of the previous software (the one with the problem), but without the last edits. The software run fine. Than, I did some basic edits (part of those I did before), and the same problem appeared. I, than, deleted those last edits, and the problem persisted.

    \o/

  8. #8
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Terrible unidentified problem!

    You've not been copying and pasting have you? This can introduce seemingly invisible characters that your editor doesn't display, but your compiler can fall over on.

  9. #9
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Terrible unidentified problem!

    Quote Originally Posted by Momergil View Post
    How, that is trully a technical help xDD

    Anyway, here is what I did: I created a new project and included the same files of the previous software (the one with the problem), but without the last edits. The software run fine. Than, I did some basic edits (part of those I did before), and the same problem appeared. I, than, deleted those last edits, and the problem persisted.

    \o/
    OK. So now you know that the problem is with the code you added. Try removing it bit by bit - or start over and add it back bit by bit - until you find the problematic section.

Similar Threads

  1. Unidentified problem
    By Momergil in forum Qwt
    Replies: 2
    Last Post: 13th September 2011, 15:58
  2. Replies: 8
    Last Post: 28th December 2009, 11:32

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.