简体   繁体   English

为了在 linux 中运行 C 代码,`gcc -g -lm -std=c99 -Wall -Wextra` 是什么意思?

[英]For running C code in linux what does `gcc -g -lm -std=c99 -Wall -Wextra` means?

These will be the flags used to run my code, I am a beginner in C and don't know what each one is used for.这些将是用于运行我的代码的标志,我是 C 的初学者,不知道每个标志的用途。 The code I must write for this is basically a string manipulation.我必须为此编写的代码基本上是字符串操作。 Wonder if there is a website that gets many flags together?想知道是否有一个网站可以将许多标志放在一起?

gcc -g -lm -std=c99 -Wall -Wextra

gcc - the compiler program gcc - 编译程序
-g - makes it easier / possible to debug the program in a debugger such as gdb - read more about it in another StackOverflow topic -g - 使在gdb等调试器中调试程序变得更容易/可能 - 在另一个 StackOverflow 主题中阅读有关它的更多信息
-lm - link to the library libm (the math library) -lm - 链接到库libm (数学库)
-std=c99 - use the C standard from 1999 -std=c99 - 使用 1999 年的 C 标准
-Wall - enables all warnings about constructions that some user consider questionable, and that are easy to avoid -Wall - 启用有关某些用户认为有问题且易于避免的结构的所有警告
-Wextra - enables some extra warning flags that are not enabled by -Wall -Wextra - 启用一些-Wall未启用的额外警告标志

You can read more about GCC warnings here您可以在此处阅读有关 GCC 警告的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM