I seem to have a strange problem:
I coded an application in C++ (using Eclipse CDT) that uses Mozilla’s Netword Security Services. This application is running fine, so I thought I can just move the appropriate classes/headers/sources to another project (can this generally be done?). The original project uses some additional headers located in /usr/include/nspr and libnss3.
This other project is compiled using CMake. So I told CMake to add /usr/include/nspr to the include path and to use libnss3. However, when I try using the classes within this other project, I get the following error when compiling:
In file included from some-dir/src/import/FirefoxImporter.h:21:0,
from some-dir/src/import/Import_Firefox.h:26,
from some-dir/src/mainwindow.cpp:28:
/usr/include/nss/secmodt.h:85:25: error: expected unqualified-id before ‘;’ token
Line 85 in secmodt.h looks as follows:
PK11SlotInfo **slots; /* array of slot points attached to this mod*/
And PK11SlotInfo is typedef’d in secmodt.h:
typedef struct PK11SlotInfoStr PK11SlotInfo; /* defined in secmodti.h */
However, I was not able to locate secmodti.h on my system (however, the original program compiled and executed just fine).
Has anybody experienced similar problems and solved them?
i suspect you have included QT before secmodt.h. ‘slots’ is a QT moc keyword.
Update
i guessed this because QT is a popular library (and i knew of its usage of
slots). plus, this type of error looked like typical preprocessor nonsense.QT’s
#defined ‘slots’ to nothing for use with its Meta Object Compiler.you can either: (possibly?) include QT at some point after
secmodt.h, or (possibly?) addno_keywordsto your config — then pray to the compiler gods.