GCC编译多个C文件
来源:互联网 发布:播放器 p2p m3u 网络 编辑:程序博客网 时间:2024/06/05 23:51
下午做了一个小的程序,定义了三个文件:getop.h,getop.c,calcDemo.c
显然getop.h是针对getop.c的,而在calcDemo.c中要调用到getop.c中的东西。
首先给出每个文件的结构图,为了更简单的说明,函数都空实现。
getop.h:
#ifndef _H_GETOP
#define _H_GETOP
int getch(void);
void ungetch(int c);
int getop(char s[]);
#endif
getop.c
#include <stdio.h>
#include <ctype.h>
#define NUMBER '0'
int getch(void);
void ungetch(int);
int getop(char s[])
{
return 0;
}
#define BUFSIZE 100
char buf[BUFSIZE];
int bufp =0;
int getch(void)
{
return 0;
}
void ungetch(int c)
{
}
calcDemo.c
#include <stdio.h>
#include <stdlib.h>
#include "getop.h" //只需这样引用即可,不可以用<>引用。
最后,即是利用gcc来编译这几个文件:
gcc getop.c calcDemo.c -o output.out
编译后的目标文件即为:output.out
然后执行:./output.out即可
- GCC编译多个C文件
- GCC编译多个c文件
- gcc编译多个c文件
- gcc编译多个c文件
- GCC 编译多个文件
- 怎样用gcc 一次性编译多个objective c文件啊
- gcc编译步骤,gcc编译多个文件
- gcc 编译.c文件
- windows命令行(或linux)下用gcc/g++编译多个c/cpp文件
- 多个.c文件编译
- gcc编译c文件指导
- gcc编译运行c文件
- GCC编译c语言文件
- GCC编译单个或者多个源文件helloworld.c
- gcc多文件编译
- GCC多文件编译
- gcc和g++区别,使用g++编译多个文件
- gcc编译多个文件与makefile应用
- 搜索背后的奥秘——浅谈语义主题计算
- flex4 图片/组件 拖放的简单实现
- Passport验证
- 数组实现大数阶乘
- BNU28000 Maxim and Restaurant
- GCC编译多个C文件
- Titanium 备忘2
- Objective C内存管理进阶(二):理解autorelease
- Cookie欺骗 腾讯拍拍秒杀活动的验证码漏洞
- Mat, vector<point2f>,Iplimage等等常见类型转换
- 内存池
- 学习笔记
- 【vc】CArchive的对象使用
- Bitmap Font Generator