[Qt-interest] What's wrong with this debug Macro

Rohan McGovern rohan.mcgovern at nokia.com
Thu Jun 11 08:26:40 CEST 2009


On Thursday 11 June 2009, ext Kermit Mei wrote:
> Hello, community!
> For convenience, I define a macro to print the debug infomation:
>
> #define DWHERE()                                             \
>   qDebug(”##FILE: %s ##LINE: %d  ##FUNC: %s”,                \
>          __FILE__, __LINE__, __FUNCTION__);
>
> Macro DWHERE() will print the file, line, and function for me,
> but it can't be compiled, why?

Hi,

If the macro is exactly as you've pasted here, then the problem is 
probably that the quote characters are "smart quotes".  i.e., you 
have used ” and ”.  Only " must be used.

That's a common problem if you copy and paste code from sources 
which "helpfully" transform quotes to smart quotes, e.g. some 
documentation formatted for HTML.

-- 
Rohan McGovern
Qt Software, Nokia




More information about the Qt-interest-old mailing list