Archived

This topic is now archived and is closed to further replies.

X_Breaker

A problem with header files...

Recommended Posts

X_Breaker    122
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

Share this post


Link to post
Share on other sites
X_Breaker    122
I think you''re right... however, now I''m getting linker errors. I''m pretty sure they''re unrelated, however. Man... trying to get multiple files to work together should NOT be this hard...

Share this post


Link to post
Share on other sites