How can I use #pragma message() so that the message points to the file(lineno)?
问题 In order to add 'todo' items into my code, I want to put a message in the compiler output. I would like it to look like this: c:/temp/main.cpp(104): TODO - add code to implement this in order to make use of the Visual Studio build output functionality to navigate to the respective line by double-clicking it. But the __LINE__ macro seems to expand to an int , which disallows writing #pragma message( __FILE__ "("__LINE__"): ..." ) Would there be another way? 回答1: Here is one that allows you to