MSVC ++如何在编译期间输出某些东西到“输出” - 窗口 [英] MSVC++ how to ouput something to the "output"-window during compilation

查看:137
本文介绍了MSVC ++如何在编译期间输出某些东西到“输出” - 窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有时我看到某些项目在编译期间写入输出。

$ p $ b / p>

  #define MESSAGE(t)message(__ FILE__(STRINGXXX(__ LINE__)):t)
#定义STRINGXXX(x)STRINGYYY(x)
#define STRINGYYY(x)#x

那么如果你放

  #pragma MESSAGE(TODO:testing)

它会像正常的编译器消息一样显示为可点击的消息


sometimes i see that certain projects write something to the output during compilation.

how can that be achieved in MSVC++

thanks!

解决方案

use #pragma message e.g.

#define MESSAGE(t) message(__FILE__ "(" STRINGXXX(__LINE__) ") : " t)
#define STRINGXXX(x) STRINGYYY(x)
#define STRINGYYY(x) #x

then if you put

#pragma MESSAGE("TODO: testing")

it will appear as a clickable message just like the normal compiler messages

这篇关于MSVC ++如何在编译期间输出某些东西到“输出” - 窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆