Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C Language: what does the .mm extension stand for?

A project with some Objective-C has a few C classes with the implementation files having a .mm extension.

file.h file.mm 

What does the .mm mean? Shouldn't it just be .m?

like image 752
aneuryzm Avatar asked Apr 26 '12 14:04

aneuryzm


People also ask

What is Objective-C extension?

Objective C files In objective C, files normally use the extension . h for interface files and the extension . m for implementation files.

What is a .MM file Xcode?

mm are class file extensions of source code for Mac-based applications. . m files can contain both Objective-C and Objective-C++ classes. To avoid conflicts between the two in mixed-use scenarios there's the convention to rename all Objective-C++ class files to . mm . This helps compilers to distinguish.

What are .MM files?

An MM file contains a "mind map," which is a visual diagram that consists of text, nodes, branches, shapes, and icons that represent ideas. It may be created by a variety of "mind-mapping" programs, such as FreeMind and Freeplane.


2 Answers

The extension .mm is the extension for the C++ compilation unit expected by the Objective-C compiler, while the .m extension is the extension for the C compilation unit expected by the Objective-C compiler.

That's assuming you don't use a compiler flag to override the file extension, as this gentleman has done.

like image 82
Edwin Buck Avatar answered Oct 02 '22 15:10

Edwin Buck


Objective C++, mixes C++ and Objective C. http://en.wikipedia.org/wiki/Objective-C#Objective-C.2B.2B

like image 40
djechlin Avatar answered Oct 02 '22 15:10

djechlin