I did not use Q_INIT_RESOURCE earlier because I thought it would be loaded automatically. After adding the line I am now facing a new error while compilation. It is giving me an "unresolved external symbol" error.
Error message :
unresolved external symbol "int __cdecl qInitResources_project(void)" (?qInitResources_project@@YAHXZ) referenced in function _main
My resource file is stored in a folder called Resources.
Contents :
<RCC>
<qresource prefix="Project">
<file>options.png</file>
</qresource>
</RCC>
Main function :
int main (int argc, char* argv[])
{
Q_INIT_RESOURCE (project);
// Create a QApplication with passed arguments
// Create the main program window
MainWindow mw;
// Main window geometry management
int width = 800;
int height = 640;
// Show the main window.
mw.show();
return app.exec();
}
int main (int argc, char* argv[])
{
Q_INIT_RESOURCE (project);
// Create a QApplication with passed arguments
QApplication app (argc, argv);
// Create the main program window
MainWindow mw;
// Main window geometry management
int width = 800;
int height = 640;
// Show the main window.
mw.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks