在Ubuntu中编译C代码时我使用Gcc,我的一个朋友建议使用以下命令编译, [英] While Compiling C Code In Ubuntu I Use Gcc, One Of My Friend Suggested That Use The Following Command To Compile,
问题描述
在unix中编译代码时,我的朋友建议尝试以下命令,即命令是
1.gcc test.c -l sqlite3 -o tt
2.#gcc Sqlite_test.c -l sqlite3 -o tt
在命令-l中都被使用,这又用于什么以及使用的原因是什么#gcc。
While compiling the code in unix,my friend suggested that try the following command i.e the command is
1.gcc test.c -l sqlite3 -o tt
2.# gcc Sqlite_test.c -l sqlite3 -o tt
in both the command -l is used and what is this used for moreover what is the reason of using # in front of gcc.
推荐答案
在命令中 - 使用l以及用于
in both the command -l is used and what is this used for
The documentation helps: "GCC, Options for Linking"[^].
在gcc前面使用#的原因是什么。
what is the reason of using # in front of gcc.
'#
'字符启动对于shell,评论行,他nce
The '#
' character starts a comment line for the shell, hence
# gcc Sqlite_test.c -l sqlite3 -o tt
什么都不做。
iirc the' -l'选项说'链接此(库)'或'搜索此库以获取可链接的引用'
iirc the '-l' option says 'link against this (library)' or 'search this library for linkable references'
这篇关于在Ubuntu中编译C代码时我使用Gcc,我的一个朋友建议使用以下命令编译,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!