A problem with header files...
Here's the setup (thus far):
I have two source files, and one header file. In one source file, I have a function, "DirectX_Init()" and in the other source file, I have a call to the aforementioned function. I also declare it as an extern in the header file. But, I'm getting redefinition errors for the variables in the function.
The function itself, as listed in the source file:
int DirectX_Init(void* parms = NULL, num_parms = 0)
{
// code
}
The call to the function in the other source file:
DirectX_Init();
And finally, the function as listed in the header file so that it can be called:
extern int DirectX_Init(void* parms = NULL, num_parms = 0);
Upon compiling, I get the following two errors:
error C2572: 'DirectX_Init' : redefinition of default parameter : parameter 2
error C2572: 'DirectX_Init' : redefinition of default parameter : parameter 1
How do I fix this?
Edited by - X_Breaker on February 6, 2002 2:49:12 AM
Try to remove the
That may be the cause of the problem.
... = NULL
and ... = 0
from the definition of the function in the cpp file.That may be the cause of the problem.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement