The Linux Page

Compile C/C++ files with weird extensions

cl.exe has a special option to be told that the input file is a C (/Tc) or a C++ (/Tp) file. This is necessary if you want to use an extension other than the default .c, .cxx and .cpp. For instance, many people use .cc or .c++ for C++ files. Just add the /Tp command line option and your file will be accepted as a C++ file no matter what the extension is.

Also, in your environment, you can change the editor and Open/Close feature to recognize these files. The Microsoft page available here:

https://support.microsoft.com/en-US

explains how you can tweak the registry for VC6 to get smarter. You have something similar in VC7, but that's not in the registry. Instead it is in some sub-folder. As a quick reference, there is what you can add in the registry to support .cc and .c++ files (note that this does NOT affect the compiler, only the IDE):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.cc]
@="cppfile"
"Content Type"="text/plain"
"PerceivedType"="text"

[HKEY_CLASSES_ROOT\.c++]
@="cppfile"
"Content Type"="text/plain"
"PerceivedType"="text"

# WARNING: KEYS ARE WRITTEN ON ONE LINE, NOT THREE!
[HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Build
			System\Components\Platforms\Win32
			(x86)\Tools\32-bit C/C++ Compiler for 80x86]
"Input_Spec"="*.c;*.cpp;*.cxx;*.cc;*.c++"

[HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Text Editor\Tabs/Language
Settings\C/C++]
"FileExtensions"="cpp;cxx;c;h;hxx;hpp;inl;tlh;tli;rc;rc2;cc;c++"

Make sure you don't have the IDE already opened whenever you make these changes.