error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
-
I am developing a qt project, with some generic classes that use glib. Because of this i was getting error about signals but i solved it with adding
#undef signals#define signalskeywords before and afterglibincludes. Now i started to add this generic headers to my headers. My include hierarchy like this:
HEADER1(generic header file):#undef signals #include <glib.h> ... #define signalsHEADER2(generic class' header):
#include "header1.h"HEADER3(my class header):
#include "header2.h"But now i am again in trouble with signals keyword. When i built it i got
../../myproj/header3.h:39:5: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive] ../../myproj/header3.h:38:8: error: expected ‘;’ at end of member declaration 38 | signals:When i include
header2to my.cpp, i dont get this error. when including it to my header files, i got error and It gives me"signals" redefinedwarning too. How can i work around the issue? What is wrong now? -
I am developing a qt project, with some generic classes that use glib. Because of this i was getting error about signals but i solved it with adding
#undef signals#define signalskeywords before and afterglibincludes. Now i started to add this generic headers to my headers. My include hierarchy like this:
HEADER1(generic header file):#undef signals #include <glib.h> ... #define signalsHEADER2(generic class' header):
#include "header1.h"HEADER3(my class header):
#include "header2.h"But now i am again in trouble with signals keyword. When i built it i got
../../myproj/header3.h:39:5: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive] ../../myproj/header3.h:38:8: error: expected ‘;’ at end of member declaration 38 | signals:When i include
header2to my.cpp, i dont get this error. when including it to my header files, i got error and It gives me"signals" redefinedwarning too. How can i work around the issue? What is wrong now?@masa4 see this section of the documentation:
https://doc.qt.io/qt-6/signalsandslots.html#using-qt-with-3rd-party-signals-and-slotsin essence, "Disable" qt signals and slots keywords and replace them with
Q_SIGNALSandQSLOTS -
@masa4 see this section of the documentation:
https://doc.qt.io/qt-6/signalsandslots.html#using-qt-with-3rd-party-signals-and-slotsin essence, "Disable" qt signals and slots keywords and replace them with
Q_SIGNALSandQSLOTS