Using QT 4.7.0 (creator 2.0.0)
A simple static const member initilization seems to cause MSVC runtime error, so QT Creator IDE won't even start the debugger.
The program ends with error code 3 and prints "Invalid parameter passed to C runtime function."
My code as follows, including tests to narrow the possible errors:
class.h
Class {
--
private:
static const QPixmap defaultIcon;
static const QPixmap* defIcon;
static const char test;
static const QChar test2;
static const char test3[4];
static const QChar test4[4];
static const QChar* test5[4];
};
end of class.h
class.cpp
// These two will both compile, but either will result in runtime error
const QPixmap Node::defaultIcon = QPixmap();
const QPixmap* Node::defIcon = new QPixmap();
// All these compile and work well
const QPixmap* Node::defIcon = 0;
const char Node::test = 'a';
const QChar Node::test2 = 'b';
const char Node::test3[4] = {'c', 'd', 'e', 'f'};
const QChar Node::test4[4] = {QChar('g'), QChar('h'), QChar('i'), QChar('j')};
const QChar* Node::test5[4] = { new QChar('k'), 0, 0, 0 };
end of class.cpp
Bookmarks