There are two variables defined in the header files that keithley.h includes: pulse_struct pulse[MAXIMUM_CHANNELS]; IN pulsestruct.h and CAPCOMP COMP590[4]; IN ki590_INTERNAL Besides being a non-standard way of defining a variable, it causes a person writing a debug task much grief if that person uses .cpp files rather than .c files. Apparently when the Visual Studio compiler "in C mode" compiles .h files containing variable definitions, those variables are marked as static by default. Thus there is no problem because the compiler doesn't care about each .c file having its own copy of the variable. However, in C++ mode the header variables are not static by default, thus each time keithley.h is included 2 more of the variables are created and when linking there will be a bunch of "error LNK2005: _COMP590 already defined " errors. The variables should be defined in .c files and then declared in the header files with the extern keyword. If the intention was actually to have static variables in each file that includes those header files (which I doubt is the case), each .c file should itself explicitly declare the static variable. Similar problems arise from the definition of KTEStderr and KTEStdout in kteprintf.h.