Error after including "TCanvas.h"

I am using 5.26 under windows xp.

I successfully built a dll project using root libary. When I use this dll in my test project, if I don’t include “TCanvas.h” in my original dll project, everything is fine; but if I include “TCanvas.h” in my original dll project, I get the following error when I compile my test project:

root\include\TVirtualX.h(183) : error C2059: syntax error : ‘constant’

After I find Brun mentioned it before:

2008-01-22 22:31 brun

* [r21818] eve/src/TEveText.cxx: From Bertrand:
  - Removed #include "FTFont.h" from TEveText.cxx. It was
  generating a weird error on Windows:
  c:\users\bellenot\root\include\TVirtualX.h(181) : error C2059:
  syntax error : 'constant'
  And it was useless anyway (removing it doesn't change

It seems we don’t have “FTFont.h” from TEveText.cxx in version 5.26. Any comment? Thanks.


I suspect you are bitten by the defines from windows.h.
Try including Windows4Root.h instead of windows.h – it undefs some symbols afterwards – have a look at the file.

Good luck!