We recommend using the qmake makefile generation tool for building your makefiles. By adding some rules to your program's makefile, make can take care of running moc when necessary and handling the moc output. Writing Make Rules for Invoking mocįor anything but the simplest test programs, it is recommended that you automate running the moc. This object should then be included in the list of object files that are linked together in the final building phase of the program. This file should then be compiled as usual, resulting in an object file, e.g., moc_myclass.obj on Windows. If the class declaration is found in the file myclass.h, the moc output should be put in a file called moc_myclass.cpp. Whenever qmake is run, it parses the project's header files and generates make rules to invoke moc for those files that contain a Q_OBJECT macro. If you use qmake, this is done automatically. The output produced by moc must be compiled and linked, just like the other C++ code in your program otherwise, the build will fail in the final link phase.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |