如何指定include *.h文件的路径

yanchang 2001-12-17 06:33:11
当我用Editplus或UltraEdit
编译*.c文件时,使用bin目录下的tcc.exe程序编译

但总是说找不到include文件,
我如何设置能让其找到include 目录下的 *.h文件
...全文
1986 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yanchang 2002-01-25
  • 打赏
  • 举报
回复
haha
starsoft007 2001-12-17
  • 打赏
  • 举报
回复
呵呵,tcc好像有个参数的,可以通过它制定头文件的路径。
如果你有一个a.c
那么要用tcc编译的话,就是这样
tcc -IXXX a.c
-I后面跟着头文件的路径
yanchang 2001-12-17
  • 打赏
  • 举报
回复
d:\c\include\stdio.h是*.h所在目录
我运行:
tcc my.c -I d:\c\include\stdio.h
包错:
Error d:\c\include\stdio.h 138: Type mismatch in redeclaration of '_Cdecl'
Error d:\c\include\stdio.h 138: Declaration syntax error
Error d:\c\include\stdio.h 139: Type mismatch in redeclaration of '_Cdecl'
Error d:\c\include\stdio.h 139: Declaration syntax error
Error d:\c\include\stdio.h 140: Type mismatch in redeclaration of '_Cdecl'
Error d:\c\include\stdio.h 140: Declaration syntax error
Error d:\c\include\stdio.h 141: Type mismatch in redeclaration of '_Cdecl'
Error d:\c\include\stdio.h 141: Declaration syntax error
Error d:\c\include\stdio.h 142: Type mismatch in redeclaration of '_Cdecl'
Error d:\c\include\stdio.h 142: Declaration syntax error
Error d:\c\include\stdio.h 143: Type mismatch in redeclaration of '_Cdecl'
Error d:\c\include\stdio.h 143: Declaration syntax error
Error d:\c\include\stdio.h 144: Type mismatch in redeclaration of '_Cdecl'
Error d:\c\include\stdio.h 144: Declaration syntax error
Error d:\c\include\stdio.h 145: Type mismatch in redeclaration of '_Cdecl'
Error d:\c\include\stdio.h 145: Too many error or warning messages
*** 26 errors in Compile ***
d:\a\d\d.c:
Error d:\a\d\d.c 1: Unable to open include file 'stdio.h'
Warning d:\a\d\d.c 7: Function should return a value in function main
*** 1 errors in Compile ***

Available memory 4170964
yug 2001-12-17
  • 打赏
  • 举报
回复
Turbo C Version 2.0 Copyright (c) 1987, 1988 Borland International
Syntax is: TCC [ options ] file[s] * = default; -x- = turn switch x off
-1 80186/286 Instructions -A Disable non-ANSI extensions
-B Compile via assembly -C Allow nested comments
-Dxxx Define macro -Exxx Alternate assembler name
-G Generate for speed -Ixxx Include files directory
-K Default char is unsigned -Lxxx Libraries directory
-M Generate link map -N Check stack overflow
-O Optimize jumps -S Produce assembly output
-Uxxx Undefine macro -Z Optimize register usage
-a Generate word alignment -c Compile only
-d Merge duplicate strings -exxx Executable file name
-f * Floating point emulator -f87 8087 floating point
-gN Stop after N warnings -iN Maximum identifier length N
-jN Stop after N errors -k Standard stack frame
-lx Pass option x to linker -mc Compact Model
-mh Huge Model -ml Large Model
-mm Medium Model -ms * Small Model
-mt Tiny Model -nxxx Output file directory
-oxxx Object file name -p Pascal calls
-r * Register variables -u * Underscores on externs
-v Source level debugging -w Enable all warnings
-wxxx Enable warning xxx -w-xxx Disable warning xxx
-y Produce line number info -zxxx Set segment names


-I 就是指定include的路径了

70,039

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧