2011-10-20 94 views
0

我運行下面的如何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

[email protected]:<Other dirs>/gcc/arm-linux-androideabi/4.4.3/include-fixed/ ls 
limits.h linux README stdio.h sys syslimits.h 

什麼想法?

回答

0

,則應該更換-L-I在編譯行

-L是連接庫和-I是增加了包括搜索路徑。

所以你可能會得到另一個錯誤,當它編譯和連接不上,那麼你將需要添加一個-L-l(除非你只需要添加與完整路徑需要的庫)

2

包含文件,你可能希望使用-I而不是-L這是您用來指定共享和靜態庫本身的位置。