Hello, I have an error when I have a Warning : unused variable. I really don't understand why the compiler show that is a Warning and why it takes it for an error
when I compil this code :
#include <QApplication>
#include <QFont>
#include <QMainWindow>
#include "Graph.h"
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QMainWindow *window=new QMainWindow();
Graph* gr=new Graph(window);
window->show();
return app.exec();
}
I have this messages :
/home/rv/Bureau/Qt/CustomWidgets/Graph01/main.cpp||In function «int main(int, char**)»:|
/home/rv/Bureau/Qt/CustomWidgets/Graph01/main.cpp|10|attention : unused variable «gr»|
||=== Build finished: 1 errors, 0 warnings ===|
and when I compil this one :
#include <QApplication>
#include <QFont>
#include <QMainWindow>
#include "Graph.h"
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QMainWindow *window=new QMainWindow();
Graph* gr=new Graph(window);
gr->y();
window->show();
return app.exec();
}
-------------- Build: Release in Graph01 ---------------
Compiling: main.cpp
Linking executable: release/Graph01
Output size is 20,09 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
I think it is due to a bad configuration of gcc in Code::Blocks but I don't see which option causes this behaviour
thanks
RV