<!–StartFragment –>
<div>I first created a project on the official qt, in the project there is a MapPainter class I wrote to display the map. In this class, there is a viewMap() function to display the map. The project is running normally, but I created an empty Felgo project. Nothing has been changed in this project. Only the files of this class are added to the project and it cannot be run. I have followed the tutorial to change the live client. Here are some key codes:</div>
<div>Error on line :</div>
<div>
MapReader reader;
bool MapViewer::viewMap(const QString &fileName, QPainter *painter){
MapReader reader; // This is the error reported by this statement
return true;
}
I did not show the irrelevant code, only the key code.MapReader is a class defined in the dynamic library.(After testing, I found that many classes in libraries cannot declare objects)
I added 3 sentences in the pro file:
INCLUDEPATH += $$PWD/source/
LIBS += -LD:/IM/Felgo/CppAndQml/CppAndQml/lib/
LIBS += -ltiled
</div>