#### Archived

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

# A problem with header files...

## Recommended Posts

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 on other sites
Try to remove the ... = NULL and ... = 0 from the definition of the function in the cpp file.
That may be the cause of the problem.

##### Share on other sites
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 on other sites
I got it now. Duh... I forgot to call INITGUID.

• ### Forum Statistics

• Total Topics
628320
• Total Posts
2982056

• 11
• 9
• 9
• 13
• 11