关于网友提出的“ 急急,问gcc连接的问题。高手请进”问题疑问,本网通过在网上对“ 急急,问gcc连接的问题。高手请进”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: 急急,问gcc连接的问题。高手请进
描述: gcc -g -O2 -D_REENTRANT -Wall -D__EXTENSIONS__ -o udpcli10 udpcli10.o big.o
../libunp.a -lresolv -lsocket -lnsl -lpthread
请问“-g -O2 -D_REENTRANT -Wall -D__EXTENSIONS__”是什么意思.?
解决方案1: -Wall 是控制警告的。
-g是生成可以给gdb用的信息,其他的友人已经说了
解决方案2: -g
Produce debugging information in the operating system's native format (stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging information.
-O2
Optimize even more. Nearly all supported optimizations that do not involve a space-speed tradeoff are performed. Loop unrolling and function inlining are not done, for example. As compared to -O, this option increases both compilation time and the performance of the generated code.
-Wall
All of the above `-W' options combined. These are all the options which pertain to usage that we recommend avoiding and that we believe is easy toavoid, even in conjunction with macros.
-o file
Place output in file file. This applies regardless to whatever sort of output GCC is producing, whether it be an executable file, an object file, an assembler file or preprocessed C code.
别的我不知道,自己用man gcc看看帮助阿!
解决方案3: 定义REENTRANT、_EXTENSIONS_宏。
至于具体的意思就要看这个宏如何定义以及如何使用的了。
譬如说使用一些线程安全的函数就编译时必须 -D_REENTRANT
以上介绍了“ 急急,问gcc连接的问题。高手请进”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/3421435.html