找回密码
 注册
查看: 1582|回复: 3

GCC怎么链接自己写的.h头文件

[复制链接]
发表于 2005-1-8 13:47:30 | 显示全部楼层 |阅读模式
main.c

#include <main.h>


GCC编译的时候命令是什么?把main.h链接进来????
在线等
发表于 2005-1-8 16:29:26 | 显示全部楼层
没看懂你的问题,编译的话

gcc -o main main.c
回复

使用道具 举报

发表于 2005-1-10 11:46:29 | 显示全部楼层
指明路径,比如说#include "./touwenjian.h"
回复

使用道具 举报

发表于 2005-1-10 13:21:09 | 显示全部楼层
#include "main.h"
.
.
.
.
.


gcc -I. xxxxxxxxxxxxx
假设你的main.h在当前目录下
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2025-2-9 14:30 , Processed in 0.021157 second(s), 16 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表