首页 > 系统服务 > 详细

在Linux下使用LLVM Clang以及Blocks

时间:2015-08-26 15:28:31      阅读:314      评论:0      收藏:0      [点我收藏+]

可以从这个链接下载:http://llvm.org/releases/download.html

sudo 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!\n");
    };
    hello();
    return 0;
}


编译与连接:
clang test.c -fblocks -lBlocksRuntime -o test

在Linux下使用LLVM Clang以及Blocks

原文:http://www.cnblogs.com/zenny-chen/p/4760384.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!