mac gcc develop

1:check version

  gcc -v   /   g++ -v

2:compile

  gcc *.c   / g++ *.cpp

  outfile: a.out

3:excute

  ./a.out

4:show excute time

  time ./a.out

5:change the after compiled file name

  gcc -o result test.c

  ./result

-c选项:只把源代码(.c文件)编译成目标代码(.o文件),但跳过连接一步。它能使编译多个C程序时的速度更快且更加容易管理。默认时,gcc建立的目标代码文件只有一个.o的扩展名。

gcc -c test.c

-S选项:告诉gcc在C程序文件产生了汇编语言文件后停止编译,产生的汇编语言文件的默认文件扩展名为.s。

gcc -S test.c

-E选项:指示编译器只对输入的文件进行预处理,且预处理的输出将被送到标准输出而不是储存在文件里。

gcc -E test.c

时间: 2024-08-27 18:41:38

mac gcc develop的相关文章

mac gcc 编译错误 基础问题

mac gcc  Undefined symbols for architecture x86_64 "std::__1: // Undefined symbols for architecture x86_64: "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from: std::__1::basic_ostream<char, std::__1::char_tra

[Cocos2d-x v3.x]Mac OX 创建新的Cocos2d-x 3.0 项目

文章内容来自于: http://cocos2d-x.org/wiki/How_to_Start_A_New_Cocos2D-X_Game Mac OS X 10.9 Software Requirements Xcode 4.6 (for iOS or Mac) gcc 4.7 for Linux or Android. For Android ndk-r9 or newer is required. Visual Studio 2012 (for Windows) Python 2.7.5 C

IOS学习路径

iOS Developer Roadmap Start your journey today! Where Do I Start? Becoming an iOS developer is a lot of fun and a valuable skill in today's market. But there's a catch: It isn't as easy as it looks. Even experienced programmers are challenged by deve

C++下混合编译c语言方法总结

最近在读SGI STL源码,感觉对C++的学习很有帮助,之前对于泛型.iterator.traits等等各种特性的概念非常模糊,通过这两天的琢磨,再加上<STL 源码剖析>的帮助,对C++那诡异的语法也不再害怕了. 在其中遇到的一些问题,总结如下: 1. C++空白基类最优化(EBO) 参考:http://www.xuebuyuan.com/1610977.html 如果有一个空类,如下.其所占空间并非0byte,而通常是1 byte. class A{ }; 如果有一个类,如下.而a 占1

How to Start a New Cocos2d-x Game for version 3.0

This documentation will show you how to use cocos console to create and run a new project. Runtime Requirements Android 2.3+ iOS 5.0+ OS X 10.7+ Windows 7+ Ubuntu 12.04+ Cocos2d-x v3.0+ Software Requirements Xcode 4.6 (for iOS or Mac) gcc 4.7 for Lin

[it-ebooks]电子书列表

#### it-ebooks电子书质量不错,但搜索功能不是很好 #### 格式说明  [ ]中为年份      ||  前后是标题和副标题  #### [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Objective-C to develop iPhone games http://it-ebooks.info/book/3544/ Learning Web App Developmen

Python调用C语言

Python中的ctypes模块可能是Python调用C方法中最简单的一种.ctypes模块提供了和C语言兼容的数据类型和函数来加载dll文件,因此在调用时不需对源文件做任何的修改.也正是如此奠定了这种方法的简单性. 示例如下 实现两数求和的C代码,保存为add.c //sample C file to add 2 numbers - int and floats #include <stdio.h> int add_int(int, int); float add_float(float,

(转) [it-ebooks]电子书列表

[it-ebooks]电子书列表 [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Objective-C to develop iPhone games http://it-ebooks.info/book/3544/Learning Web App Development || Build Quickly with Proven JavaScript Techniques http://

mac下使用gnu gcc

1 mac下安装gnu gcc brew search gcc brew install [email protected] 2 mac下编写c/c++代码所需的标准库和头文件 glibc不能在mac下使用,编译不通过,说不支持当前的platform. 就用mac提供的c标准库就可以了,头文件的话,需要自己安装 xcode-select --install 安装xcode command line tool 多了/usr/include目录,但是在该目录下仍然找不到stdarg.h. stdar