I noticed that qmake passes all C++ preprocessor flags to the moc utility. I tried moc without these flags on one file and it produced identical results. My question is: would there be cases in which moc would need these flags?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
moc creates a CPP file which manages the SLOTS and SIGNALS of the class.
if any of those are under preprocessor rules, MOC needs to know about it.
for example:
if you run moc without a “-DENABLE_SLOT1” parameter then the generated CPP file will not have any idea that it need to generate code handling slot1().