uROTypes using #defines for SimpleTypes, which causes compiler errors

cbuilder

(Rodrigo Gómez) #1

Hello,

I’ve just spend the best part of the morning trying to find and solve a strange compiler error. The cause of the error (when compiling units including the Xml.XMLSchema.hpp header) was that in line 240 of the uROTypes.hpp header there is a #define for SimpleTypes, which is apparently a System::Set. SimpleTypes is also a name of a property inside a class in Xml.XMLSchema.hpp but if for some reason the uROTypes header was included before, then the compiler replaces the SimpleTypes text with the #define and you get the compiler error.

I am not sure why is that using a #define, if it was generated automatically by the compiler from the PAS unit… looking at the pas unit I guess it was. Maybe then the only solution is to change the name so it doesn’t have such a “generic” one? I don’t know if there is a way to avoid the #define, maybe using an EXTERNALSYM/HPPEMIT with a typedef directive?

Im using version 9.5.111.1399 in RS 10.1 Berlin


(EvgenyK) #2

Hi,

if you rename SimpleTypes with ROSimpleTypes in uROTypes.pas and recreate uROTypes.hpp, will it solve this issue?


(Rodrigo Gómez) #3

I have not tried that, but it should work. I don’t know why the compiler chooses to do a #define instead of some other better solution for this particular type, but changing the name should solve this issue (unless there is some ROSimpleTypes text used somewhere else, but I don’t supose that’s the case).

I’ll try this weekend to rebuild RO with that change and will let you know if there was some problem or not.

Thanks.