Search code examples
c++gccqt4scientific-computingmemory-model

Qt4 Creator/QMAKE equivalent to "-mcmodel=medium" GCC compiler settings


I'm using Qt Creator to create a GUI for a fairly memory intensive C++ application on Linux. In order for the application to run properly, the -mcmodel=medium compiler flag must be set during compilation, otherwise the application will abruptly crash during execution (tried compiling in Qt without it, and it crashes as expected). How do I set the GCC flags in the .pro file to deal with this directly or is there a Qt equivalent to this memory model flag setting?

Note: I've tried QMAKE_CXXFLAGS += -mcmodel=medium and it doesn't seem to work...

Correction: QMAKE_CXXFLAGS method appears to work. Error returned was actually a hardware memory bus error.


Solution

  • QMAKE_CXXFLAGS += -mcmodel=medium