Game Development Community

A quick question on extension uses-- .cc

by William Knop · in Torque Game Engine · 08/13/2001 (11:27 am) · 12 replies

Just wondering if there is any reason why the c++ files use the .cc extension instead of usual .cpp. If there isn't, maybe it should be migrated to .cpp? It seems easier since we wouldn't have to use those reg files-- for some reason the 'edit' one didn't fix the syntax highlighting on my box (still all black text). I understand it is not a big deal, but it requires a custom configuration which may be a hassle for some people.

-Will

#1
08/13/2001 (11:58 am)
The '.cpp' extension is only "standard" to mainly newer, windows (mostly VC++) developers :-). I've always used .cc under UNIX and Windows. Only first started to see .cpp with VC++. I'm not sure about you but .cc is standard for me :-). However, I realize people have their preferences (just as I have mine) so go ahead and change them to .cpp, if that's your preference.
#2
08/14/2001 (12:33 pm)
Ok, that's cool-- I wasn't trying to say .cc is nonstandard, just that some IDEs need adjustment (which I am sure would be the same case if the engine used .cpp). Most IDEs and compilers currently recognise both extensions, but some only do one or the other without extra configuration.

Maybe someone could write up a quick batch file to toggle between the extensions. I'm going away for a week, so I won't be able to sumbit it, but if when I get back no one has, I'll whip one up. That is, if the GG team feels it's worthy of distributing. Again, it's not a big deal at all, so it probably makes little difference either way.

-Will
#3
08/14/2001 (7:07 pm)
Well, it does make a little difference:
when you perform a "Search files", VC won't search the *.cc files

And I was pondering why I couldn't find some vital functions in the first place... ;-)
#4
08/14/2001 (8:39 pm)
Just type in *.cc in the file extension box or pick *.* from the list. Trust me it works =)
#5
08/14/2001 (9:53 pm)
VC++ is the only compiler I know that has problems with the .cc extension. MS should stop trying to think for us...

--Rick
#6
08/15/2001 (4:25 pm)
Thanx Matthew, I knew that already, just meant that VC does not search for the *.cc files by default and I didn't look closer :)

But I experienced another problem:
I created a new project in a new workspace (I have the german version of VC, is it workspace? however: the dsw :), and then I added several *.cc files (e.g. from the gui directory).
Although they were compileable before (after I added the registry key, I even reviewed it myself), the compiler comes up with the warning that it cannot compile files of type *.cc ?!?

Can anyone help me out on this?
#7
08/15/2001 (4:53 pm)
in the registry script change '32-bit C/C++ Compiler for 80x86' to '32-bit C/C++ Compiler f
#8
08/15/2001 (5:13 pm)
I already changed the Registry entry correctly.
The funny thing is that compiling the Engine projects is possible, but compiling my own project brings up this warning that *.cc files cannot be compiled.

I wonder if something must be change in project properties or somewhere else, but I didn't find out yet...
#9
08/15/2001 (6:16 pm)
The problem is that VC++ knows to compile .cc's now but cl.exe doesn't without an extra option. Goto Project->Settings...->C/C++ and look in Project Options...add /Tp at the end of all of these options and you should be good to go =)
#10
08/20/2001 (2:31 am)
I do not believe the C++ standard defines "official" extensions. Depending on the complier .c, .C, .cxx, .cpp, .cc, .h, .H, .hxx, .hpp, and .hh are used. From what i recall of the first compilers supporting C++ there was no agreement on which set of file extensions should be used. There was even one odd ball that used .cp as a default extension. The fact one compiler or platform has one or another set of extensions in common usage does not really mean anything. Except perhaps to certain conspiracy theorists... :)
#11
08/22/2001 (8:36 am)
Fix your registry entries by doing this:

http://support.microsoft.com/support/kb/articles/Q181/5/06.ASP
#12
08/22/2001 (10:43 am)
You could also just run the 2 registry files in the v12/vc++ folder or just use the SDK Installer and pick Visual C++ as you compiler and it will do it automatically for you. Those registry entries only work for the English version but the fixes for other languages have been posted around this forum.

Those registry files contain all the same info on that page except associcaing .cc files to be opened by Visual Studio. It also states that you need /Tp as a compile option like a said above.