Visual Studio Confuses Me
Got in this morning to check the outcome of the daily build, and everything had built bar 1 plugin. Nothing unusual, I checked the build log and it said:
error C2059: syntax error : '<L_TYPE_raw>
The error was coming from the constructor of a simple struct:
RBG(float _r, float _g, float _b) : red(_r), green(_g), blue(_b) { }
Nothing strange about that. Perhaps RGB is conflicting with another class/struct called RGB in the global namespace? Putting it into it’s own namespace didn’t help, the same error occured.
The next thing to try was to rename the struct to RBGtmp. The above error didn’t show, but of course other errors did as anyone referring to the RGB struct now couldn’t find it.
Here’s the odd part, by adding
typedef RBGtmp RGB;
after the definition of the RGBtmp struct all compile errors dissapeared! Effectively the above statement has exactly the same outcome as defining a struct called RGB!! This is a Windows only problem, it works fine on the Linux and Mac OS builds. I have no idea what is going on, I presume it’s a bug with the VS compiler/parser. Very strange.
About this entry
You’re currently reading “Visual Studio Confuses Me,” an entry on The Moon is Down
- Published:
- 06.26.07 / 11am
- Category:
- Programming, Computers
No comments
Jump to comment form | comments rss [?] | trackback uri [?]