xcode
foreverling_ling
求索
展开
-
Xcode 如何链接多个C文件
Xcode的Command Line Tool可以编译C文件。那么如何将多个C文件链接到一起编译呢?假设我们写了三个文件 1. main.c ( main函数) 2. sum.h ( 求和函数声明) 3. sum.c( 求和函数)只要在main.c文件中include sum.h即可。在main.c文件中加入如下代码:#include "sum.h"一些可能的错误implicit decla原创 2017-04-08 19:34:57 · 4211 阅读 · 1 评论 -
ARC forbids explicit message send of 'retainCount'
遇到这种错误是因为没有打开ARC。 解决方案有两种:方案一方案二:原创 2017-04-13 13:39:17 · 783 阅读 · 0 评论 -
解决xcode printf 无输出
今天用xcode 8.3 的 Command Line Tool 新建了一个c语言程序。官方给出的例子是这样的:#include <stdio.h>int main(int argc, const char * argv[]) { // insert code here... printf("hello,world!\n"); return 0; } 运行起来,console原创 2017-04-08 12:19:44 · 6823 阅读 · 5 评论