首页 / 操作系统 / Linux / 在Linux下使用LLVM Clang以及Blocks
在Linux下使用LLVM Clang以及Blocks可以从这个链接下载:http://llvm.org/releases/download.htmlsudo apt-get install llvm
sudo apt-get install clang
sudo apt-get install libblocksruntime-dev代码:#include <stdio.h>
#include <Block.h>int main() {
void (^hello)(void) = ^(void) {
printf("Hello, block!
");
};
hello();
return 0;
}编译与连接:
clang test.c -fblocks -lBlocksRuntime -o test本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-12/126167.htm