1

I'm trying to manually calling repc on my .rep files then running moc on the header output files.
repc runs successfully, but moc randomly complains about a

parse error at '('

after a Q_CLASSINFO declaration. Any seen that issue before?

Example:

remoteminimal.rep

class RemoteMinimal
{
    SIGNAL(sendData(const QString &, const QString &));
    SLOT(void printData(const QString &));
    SLOT(void process(const QString &, const QString &));
    SLOT(void triggerSendData());
};

do

repc -i rep remoteminimal.rep -o replica rep_min_test.h

then

moc -o moc_rep_min_test.cpp rep_min_test.h

you'll get the following error:

rep_min_test.h:20: Parse error at "("

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
bardao
  • 914
  • 12
  • 23
  • you could explain in detail the steps that you use in addition to providing an example of problematic .rep – eyllanesc Feb 15 '19 at 23:39
  • added example above – bardao Feb 15 '19 at 23:50
  • I recommend publishing the code in your question and not depend on an external resource, for example I could at some point delete my repo and your question could become unusable – eyllanesc Feb 15 '19 at 23:55

1 Answers1

1

The problem is that you are not linking Qt so MOC does not find some definitions. For these cases I prefer to analyze the code generated by qmake, and in the following fragment:

/usr/bin/moc ... rep_remoteminimal_replica.h -o moc_rep_remoteminimal_replica.cpp -I /usr/include/qt -I /usr/include/qt/QtRemoteObjects

You see that it is linked /usr/include/qt:

moc -I/usr/include/qt rep_min_test.h -o moc_rep_min_test.cpp 
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • that's great, thanks. is there a "debug" or verbose mode for moc that complains about the lib not being accessible? – bardao Feb 16 '19 at 00:21
  • 1
    No, just analyze by erasing code :-) and analyze what was necessary, then just analyze why it was necessary – eyllanesc Feb 16 '19 at 00:22