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?

1

3 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.

0

Objective C++, mixes C++ and Objective C.

.mm files are like .cpp files to the Objective-C compiler. They activate the C++ compiler instead of the C compiler.

The following question on performance has additional useful information:

Objective-C, .m / .mm performance difference?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest