C语言:.mm扩展名代表什么? [英] C Language: what does the .mm extension stand for?

查看:429
本文介绍了C语言:.mm扩展名代表什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

带有一些Objective-C的项目具有一些C类,其实现文件具有 .mm 扩展名.

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

file.h
file.mm

.mm 是什么意思?它不是应该是 .m 吗?

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

推荐答案

扩展.mm是Objective-C编译器期望的C++编译单元的扩展,而.m扩展是是Objective-C编译器期望的C编译单元.

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.

这篇关于C语言:.mm扩展名代表什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆