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 signals
keywords before and afterglib
includes. 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 signals
HEADER2(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
header2
to my.cpp
, i dont get this error. when including it to my header files, i got error and It gives me"signals" redefined
warning 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 signals
keywords before and afterglib
includes. 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 signals
HEADER2(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
header2
to my.cpp
, i dont get this error. when including it to my header files, i got error and It gives me"signals" redefined
warning 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_SIGNALS
andQSLOTS
-
@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_SIGNALS
andQSLOTS