Bunch of Errors That Do Not Indicate What Source Code is at Fault
-
wrote on 14 Jun 2024, 00:06 last edited by Crag_Hack
Hi I'm getting some Visual Studio compilation errors I think are all related that do not indicate which source code is at fault. Any ideas on how to track down what's failing? I posted the errors below in a screenshot. It does say 'compiling source file ***.cpp' (I removed the actual source file name) at the end of the errors. Also it says these errors are occurring in qobject.h and qobjectdefs_impl.h and when I double-click them it takes me to the relevant code in the respective header file.
The main error might be the first (I pasted for googlers):
Error C2338 The slot requires more arguments than the signal providesI have some signal/slot connections using the connect(this,&Object::method,object,&Object::method); form and some using the connect(this, SIGNAL(method(parameters)), object, SLOT(method(parameters))); form. Does it look like a signal/slot connection is at fault? If it is a signal/slot connection at fault will switching to the first form mentioned help track down the source of the errors? Thanks!
-
-
-
Hi I'm getting some Visual Studio compilation errors I think are all related that do not indicate which source code is at fault. Any ideas on how to track down what's failing? I posted the errors below in a screenshot. It does say 'compiling source file ***.cpp' (I removed the actual source file name) at the end of the errors. Also it says these errors are occurring in qobject.h and qobjectdefs_impl.h and when I double-click them it takes me to the relevant code in the respective header file.
The main error might be the first (I pasted for googlers):
Error C2338 The slot requires more arguments than the signal providesI have some signal/slot connections using the connect(this,&Object::method,object,&Object::method); form and some using the connect(this, SIGNAL(method(parameters)), object, SLOT(method(parameters))); form. Does it look like a signal/slot connection is at fault? If it is a signal/slot connection at fault will switching to the first form mentioned help track down the source of the errors? Thanks!
Screenshot:
@Crag_Hack said in Bunch of Errors That Do Not Indicate What Source Code is at Fault:
Error C2338 The slot requires more arguments than the signal provides
The error message tells you what's going wrong - the signal must have the same amount of arguments than the slot.
-
wrote on 14 Jun 2024, 06:21 last edited by SimonSchroeder
With Visual Studio a lot of times it helps to switch over to the "Output" pane. The errors will have a lot more context. This might help to find the actual line triggering this.
To add what @Christian-Ehrlicher said: The signal can have more arguments than the slot, but the slot cannot have more arguments than the calling signal.
-
wrote on 14 Jun 2024, 18:39 last edited by
Thanks guys. All of the error messages were cause by one incorrect signal/slot connection. I narrowed it down with a binary search of the connect statements (they were mostly in one place). How come the compiler doesn't tell me where the error occurred?
-
Thanks guys. All of the error messages were cause by one incorrect signal/slot connection. I narrowed it down with a binary search of the connect statements (they were mostly in one place). How come the compiler doesn't tell me where the error occurred?
@Crag_Hack said in Bunch of Errors That Do Not Indicate What Source Code is at Fault:
How come the compiler doesn't tell me where the error occurred?
It does, look at the Output pane as @SimonSchroeder told you to see the complete compiler error message.
-
wrote on 14 Jun 2024, 19:09 last edited by Crag_Hack
@Christian-Ehrlicher OK but how come the errors don't show up in the error list where they usually are?
-
@Christian-Ehrlicher OK but how come the errors don't show up in the error list where they usually are?
@Crag_Hack said in Bunch of Errors That Do Not Indicate What Source Code is at Fault:
OK but how come the errors don't show up in the error list where they usually are?
Because template errors are large so they don't fit into the small line.
1/7