-1
我知道标题是某种愚蠢的,但我不知道如何问别人。 我试图在我的头文件(head.h
)中包含标准库(stdio.h
或string.h
)之一,然后将其包含在我的main.c
脚本中。我的Windows 7 x64 TCC(http://bellard.org/tcc/),但学院的solaris(我不知道,但它是严重的石块的东西)一切工作正常gcc 4.0.2(2005年显然)只是不这样做...(我得到“未定义的符号” 错误等)ANSI C两级包括
main.c中(节选):
#include "head.h"
head.h(节选):
// include librarys
#include <stdio.h> // standard input/output
#include <string.h> // operations on strings
#include <locale.h> // unicode string output
生成文件(完整):
CX = tcc
IN = funcdef.o main.o
outfile: ${IN}
${CX} -o outfile.out ${IN}
funcdef.o: head.h funcdef.c
main.o: head.h main.c
我在做什么错?当TCC不是时,为什么GCC的行动迟缓?D? 在此先感谢您的答案!
你会得到什么错误? – 2011-05-16 15:11:48
你收到什么错误信息?请逐字逐句。 – 2011-05-16 15:11:56
“未定义符号”是一个链接器错误,不是编译器错误。可能与'#include'无关(或者不多)。请张贴您在Solaris上使用的任何内容 - 您使用tcc进行的工作是无关紧要的。 – Mat 2011-05-16 15:12:24