c - 从源代码(GNU 编译器)与构建窗口对话

标签 c gnu

是否可以从源代码向 GNU 构建窗口传递消息? 像这样的东西:

foo.c(不是 makefile)

#ifdef DEBUG
   Echo "The Debug flag is set"

// more code here

最佳答案

查看 gcc 中的诊断编译指示:

http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html

例如

GCC also offers a simple mechanism for printing messages during compilation. `#pragma message string` Prints string as a compiler message on compilation. The message is informational only, and is neither a compilation warning nor an error.
          #pragma message "Compiling " __FILE__ "..."

关于c - 从源代码(GNU 编译器)与构建窗口对话,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12902272/

相关文章:

C - 没有函数指针的动态函数调用

如果该行包含空格,C 中的回车不能正常工作

awk - PROCINFO 如何显示特定记录上 FS 的信息?

c++ - 将两个 map 相加

gcc - 使用 GCC 编译的程序的许可证是什么?

c++ - 较大矩阵的子矩阵之和

c - 我怎样才能在pic 18f2550上运行程序

c - 用自定义条件包装 printf

emacs - gnu screen - 将默认的转义命令键更改为 ALT-X?

c - printf (_ ("hello, world\n")) 是什么意思?