c - 如何将 C 库链接到 GCC

标签 c gcc

我运行以下内容

./gcc -o test -ansi test.c -L/<other dirs>/gcc/arm-linux-androideabi/4.4.3/include-fixed/

我明白了...

test.c:3:18: error: no include path in which to search for stdio.h
test.c: In function 'main':
test.c:7: warning: incompatible implicit declaration of built-in function 'printf'

这是ls

jackie@jackie-Latitude-E6410:<Other dirs>/gcc/arm-linux-androideabi/4.4.3/include-fixed/ ls
limits.h  linux  README  stdio.h  sys  syslimits.h

有什么想法吗?

最佳答案

对于包含文件,您可能需要使用 -I 而不是 -L,后者用于指定共享库和静态库本身的位置。

关于c - 如何将 C 库链接到 GCC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7840701/

相关文章:

c - C 宏上的警告过多

C Buffer 中的控制字符

c++ - 为什么要定义sizeof实现的结果?

c - Solaris 11 中用于编译 c 程序的 CC 编译器是什么。 make 文件指定类似 "CC=cc -Xa -mt -xc99=no_lib"的内容

c++ - GCC 的 wchar_t 有多大?

xcode - 如何为 Mac OS X 10.5 编译

c++ - 为多个显示器设置 OpenGL

c - 注意 : previous implicit declaration of ‘point_forward’ was here

c++ - 在一个 Linux 发行版上使用 g++ 编译的可执行文件在另一个发行版上使用是否有限制?

mysql - 在c编程中使用mysql