1

得到一个名为 GeneralUtils.m 的文件及其头文件。我在几个 IOS 项目中使用它作为共享方法。

问:部分项目编译成功。但是其中一个项目在编译时抛出错误:比我将 m 文件扩展名更改为 mm 文件。它可以编译。但顺便说一句;其他项目不会编译并再次将 mm 扩展名重命名为“m”。

我想了解其中的逻辑。为什么我的一些 IOS 项目希望它的扩展名是 m 而另一个希望它是 mm 文件扩展名

错误详情 :

Undefined symbols for architecture armv7:
  "randIntBetween(int, int)", referenced from:
   -[Blah method1] in File1.o
   ld: symbol(s) not found for architecture armv7
   clang: error: linker command failed with exit code 1 (use -v to see invocation)
4

1 回答 1

7

The extension .m means that it is Objective-C and the extension .mm means that it is Objective-C++. So those are different files and you should know what is in it.

于 2013-08-04T18:04:42.943 回答