Objective-C和MATLAB/Octave文件扩展名之间的重叠 [英] Overlap between Objective-C and MATLAB/Octave file extensions
问题描述
除.m
之外,Objective-C或MATLAB/Octave是否具有源文件扩展名?我问是因为我将Hello World程序放在一个文件夹中,而我不能有两个hello.m
文件.
Do Objective-C or MATLAB/Octave have source file extensions besides .m
? I ask because I'm putting Hello World programs in a single folder and I can't have two hello.m
files.
推荐答案
一种解决方法是将.mm
用于Objective-C. .mm
用于Objective-C ++源文件,它是Objective-C的超集,因此应该可以很好地编译.
A workaround would be to use .mm
for Objective-C. .mm
is used for Objective-C++ source files and it is a superset of Objective-C so it should compile fine.
这绝不是一个干净的解决方案.更好的方法是按照Ruddy Velthuis的建议将文件夹重新组织为子文件夹,或者只是将源文件命名为hello-objective-c.m
和hello-matlab.m
.
This is by no mean a clean solution. A much better way would be to reorganize your folder into subfolders as suggested by Ruddy Velthuis, or simply to call your source files hello-objective-c.m
and hello-matlab.m
.
这篇关于Objective-C和MATLAB/Octave文件扩展名之间的重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!