PDA

View Full Version : QT + Problem + execute



anouar2002
20th January 2012, 06:01
Hi,,
Please, I really need help as soon as possible.
I developed a Qt application that interacts with a SQL Server database. All goes well until today.
I did not like my base so I decided to create another. What prompts me to change several instructions in all files of my code.
When I run my code again, I found it full of errors (almost 45) and these are errors in files I've ever seen (no sources or headers or xml) I decided to dc drop the base change and I returned to the old version of my code (I ranking) but here: it's a surprise the same errors are dominated my own version (that one hour before it worked perfectly). I do not know what to do? I can not redo all the work because I have to drop this Saturday
Please please help me (I apologize for this long story but I'm really stuck):eek:

ChrisW67
20th January 2012, 06:03
Thank you for your long story. Would you care to share information that might actually tell us what sort of errors you are getting, where they are coming from etc.?

anouar2002
20th January 2012, 06:12
There are 45 error :
most of them contains path
For example :
In file included
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\map:60: In file included from c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/map:60,
c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore\qma p.h:50: from c:\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtCore/qmap.h:50,
c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore\qva riant.h:49: from c:\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtCore/qvariant.h:49,
c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore\qva riantanimation.h:48: from c:\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtCore/qvariantanimation.h:48,
....
bidirectionnel iterator_tag does not name a type
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:159: erreur : 'bidirectional_iterator_tag' does not name a type
.....
expected type-specifier before 'allocator'
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:321: erreur : expected type-specifier before 'allocator'
.....
and more..

ChrisW67
20th January 2012, 06:18
... and what line of your code triggers these error messages? What are the lines around that line?

anouar2002
20th January 2012, 06:21
the problem is those error are not in files that's i wrote it. But in some file .h , that first time i see them.

ChrisW67
20th January 2012, 06:28
Copy and paste the entire error message or at least the first 10 lines or so.

anouar2002
20th January 2012, 06:35
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\map:60: In file included from c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/map:60,
c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore\qma p.h:50: from c:\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtCore/qmap.h:50,
c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore\qva riant.h:49: from c:\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtCore/qvariant.h:49,
c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore\qva riantanimation.h:48: from c:\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtCore/qvariantanimation.h:48,
c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore\qpr opertyanimation.h:45: from c:\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtCore/qpropertyanimation.h:45,
c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore\QtC ore:7: from c:\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtCore/QtCore:7,
c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtGui\QtGu i:3: from c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtGui/QtGui:3,
D:\Project\Gestion-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug\..\Gestion\details2.h:8: from ..\Gestion\/details2.h:8,
D:\Project\Gestion-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug\..\Gestion\details2.cpp: 1: from ..\Gestion\details2.cpp:1:
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:159: erreur : 'bidirectional_iterator_tag' does not name a type
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:231: erreur : 'bidirectional_iterator_tag' does not name a type
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:321: erreur : expected type-specifier before 'allocator'
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:321: erreur : expected '>' before 'allocator'
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:551: erreur : typedef name may not be a nested-name-specifier
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:551: erreur : expected ';' before '<' token
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:552: erreur : typedef name may not be a nested-name-specifier
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:552: erreur : expected ';' before '<' token
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:649: erreur : 'reverse_iterator' does not name a type
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:653: erreur : 'const_reverse_iterator' does not name a type
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:657: erreur : 'reverse_iterator' does not name a type
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:661: erreur : 'const_reverse_iterator' does not name a type
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:685: erreur : expected ';' before '<' token
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:759: erreur : expected ';' before '<' token
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:762: erreur : expected ';' before '<' token*
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:-1: In function 'bool Ui::std::operator==(const Ui::std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&, const Ui::std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&)':
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:-1: In function 'bool Ui::std::operator<(const Ui::std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&, const Ui::std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&)':
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:-1: In function 'bool Ui::std::operator<(const Ui::std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&, const Ui::std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&)':
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:-1: At global scope:
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:-1: At global scope:
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:1043: erreur : expected constructor, destructor, or type conversion before '<' token
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:1074: erreur : expected constructor, destructor, or type conversion before '<' token
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:-1: In member function 'void Ui::std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::swap(Ui::std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&)':
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:1153: erreur : '__alloc_swap' is not a member of 'Ui::std'
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:1153: erreur : expected primary-expression before '>' token
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:1153: erreur : '::_S_do_it' has not been declared
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\includ e\c++\bits\stl_tree.h:-1: At global scope:

ChrisW67
20th January 2012, 06:38
What is at or around line 8 of file ..\Gestion\/details2.h?

anouar2002
20th January 2012, 06:41
sorry didn't unserstand ??

ChrisW67
20th January 2012, 06:47
The error message contains two lines that reference your source code. The files are ..\Gestion\/details2.h and ..\Gestion\details2.cpp (on your D drive).
Your source code is the thing that changed... therefore we are looking for problems in that source that are cascading into other things that get included.


Also, do a clean build: Build menu, Clean All followed by Build menu, Build All

anouar2002
20th January 2012, 06:55
for the files details.h and details2.h, the error are on line 1 : #include "details2.h"
and line 8 : #include <QtGui>

( i did a build and clean and nothing as result)

ChrisW67
20th January 2012, 07:01
What is on lines 1 through 7 of details2.h?

anouar2002
20th January 2012, 07:04
#ifndef DETAILS2_H
#define DETAILS2_H

#include <QDialog>

namespace Ui {
class details2;
#include <QtGui>

ChrisW67
20th January 2012, 07:10
My best guess at this point is that you need to close the namespace:


#ifndef DETAILS2_H
#define DETAILS2_H

#include <QDialog>

namespace Ui {
class details2;
} // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< this line missing

#include <QtGui>

anouar2002
20th January 2012, 07:14
there is } :



#ifndef DETAILS2_H
#define DETAILS2_H

#include <QDialog>

namespace Ui {
class details2;

#include <QtGui>
#include <QtSql>
#include <QtCore>

}

ChrisW67
20th January 2012, 07:16
Move it unless you really want to try to put qt into the Ui namespace.

anouar2002
20th January 2012, 07:21
I move it but another error comes at line 67 : else without a previous if
but there is a if ,,,???????????


qry.bindValue(":Code_Barre",numero);
qry.bindValue(":Nom_Lot",nom);
qry.bindValue(":Fiche_Allocation",fiche);
qry.bindValue(":Id_Casier",valeur);
if(qry.exec()){

QMessageBox::information(this,"Information","L'operation d'ajout a été réalisée avec succèss !");
ui->lineEdit->clear();
ui->lineEdit_2->clear();
ui->lineEdit_3->clear();}
ui->comboBox->setCurrentIndex(0);
/*line 67*/ else {

QMessageBox::warning(this,"Erreur","L'operation d'ajout a rencontré un problème !");

}

ChrisW67
20th January 2012, 07:33
Look harder at line 10!

anouar2002
20th January 2012, 07:34
i correct many errors ( i don't know from where they comes ) but now : Error is
The program ended suddenly.

ChrisW67
20th January 2012, 08:14
Run the program in a debugger. When it crashes look at the backtrace. I do not intend to hand hold you through fixing every little quirk in your code.

wysota
20th January 2012, 12:14
And for your next project use a version control system such as subversion, it really helps in such situations.

anouar2002
20th January 2012, 18:56
Hello,
Thank you for answering,
Chris, you are right, but as i said i fixed all errors , this is the problem now :



Echec de l'excutable :
Une exception at 0x7c97478e, code: 0x0000139: DLL entry point not found, flags=0x0.
During startup program exited with code 0x0000139.

Added after 1 22 minutes:

Thanks ,
I resolve the problem. (must Deleting all files before copy news files )