RSX
10th March 2011, 23:39
Not sure if it's right board but it concerns Qt so... I got this code:
// main.h
#include "ui.h"
class Main {
public:
Main()
{
}
void init() {
ui.show();
}
private:
UI ui;
};
// main. cpp
#include "main.h"
#include <QtGui/QApplication>
Main g_main;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
g_main.init();
return a.exec();
}
And the problem is that creating g_main as a global variable gives me this:
URL removed
With some console errors:
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Exited with code 3
When I put Main g_main as a local variable into main() function then everything works fine. Moreover, in another project (without Qt) I have no such problem.
I'm using Qt 4.7.0 with MingW.
// main.h
#include "ui.h"
class Main {
public:
Main()
{
}
void init() {
ui.show();
}
private:
UI ui;
};
// main. cpp
#include "main.h"
#include <QtGui/QApplication>
Main g_main;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
g_main.init();
return a.exec();
}
And the problem is that creating g_main as a global variable gives me this:
URL removed
With some console errors:
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Exited with code 3
When I put Main g_main as a local variable into main() function then everything works fine. Moreover, in another project (without Qt) I have no such problem.
I'm using Qt 4.7.0 with MingW.