gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 14:23:23 29 4
gpt4 key购买 nike

是否可以从源代码向 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/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com