PDA

View Full Version : Qt or Compiler bug?



jrideout
1st March 2006, 23:04
I am having trouble compiling the following code:
header


#ifndef ITEMSLISTFORM_H
#define ITEMSLISTFORM_H

#include <QtSql>
#include <QtGui>

#include "ui_itemslistform.h"

class posItemListForm: public QFrame, public Ui_itemsListForm
{
Q_OBJECT
public:
posItemListForm();
};
#endif
I removed all my other methods and such to try and see what is wrong.

implementation


#include <QtSql>
#include <QtGui>

#include "itemslistform.h"

posItemListForm::posItemListForm()
{}
// it had this before i simplified things:
// posItemListForm(QWidget *parent) : QFrame ( parent )

I use this basic style of coding for man ui forms but this gives be the following gcc errors:

It is in the out*.txt files, i had to break it up since it was so long.

Anyway, I compile qt4 apps all day long and never see a problem with this. Is it a name collision thing? what more info could help? I have tried with gcc-4 and 3.4, they have different, but similar issues. I use ubuntu, could it be a bug in there includes? Thanks in advance for any assistance.

jacek
1st March 2006, 23:16
It is in the out*.txt files, i had to break it up since it was so long.
You could also compress it.


Anyway, I compile qt4 apps all day long and never see a problem with this. Is it a name collision thing? what more info could help? I have tried with gcc-4 and 3.4, they have different, but similar issues. I use ubuntu, could it be a bug in there includes?
It looks like there is something wrong with C++ headers. Like if they were using some non-ASCII encoding.

Can you compile a simple C++ program that uses STL? Something like:
#include <vector>

int main()
{
std::vector< int > v;
v.push_back( 10 );
return 0;
}

jrideout
1st March 2006, 23:27
Can you compile a simple C++ program that uses STL? Something like:
#include <vector>

int main()
{
std::vector< int > v;
v.push_back( 10 );
return 0;
}

Yes, that works.

jacek
1st March 2006, 23:32
And if you add this:
#include <QtSql>
#include <QtGui>(before #include <vector>)?

jrideout
1st March 2006, 23:36
I figured it out, in my copyright comment in the header there was a hebrew character (accidently inserted) that somehow was interpreted as a newline. This ment that the rest of the comment was no longer discared as a comment. I should have had a better gcc error though, usually they are helpful.

Thanks, everyone

elcuco
2nd March 2006, 22:34
I figured it out, in my copyright comment in the header there was a hebrew character (accidently inserted) that somehow was interpreted as a newline. This ment that the rest of the comment was no longer discared as a comment. I should have had a better gcc error though, usually they are helpful.

Thanks, everyone
WTF? Hebrew is 220(dec) and above. I am unsure about the numbers in UTF8, but I don't think that they are 10/13 (dec). Are you sure...?

הקיצר, קומפילר מפגר - תכנת אהבל
;-)