fabriciocolombo / delphi-rest-client-api

A Delphi REST client API to consume REST services written in any programming language.
Apache License 2.0
380 stars 182 forks source link

Problem with GetAsDataSet function of TResource on DelphiXE2 #69

Open jhonatasobrinho opened 8 years ago

jhonatasobrinho commented 8 years ago

I had a problem trying to use that function on Delphi XE2. I think, someway the compile directive USE_SUPER_OBJECT was defined, but I can't specify where. So, the GetAsDataSet function wasn't avaiable for use.

I solved this problem taking off the {$UNDEF USE_SUPER_OBJECT} directive from {$IFDEF MACOS}, compiling the component again and compiling my project. So it worked. That is a bug or just my fail somewhere?

RobertoSchneiders commented 8 years ago

It's not a bug, the GetAsDataset is only available if you are using SuperObject.

Apparently, USE_SUPER_OBECT is defined by default (DelphiRest.inc#L6), but not for MacOS (DelphiRest.inc#L203)

I'm not sure why this is defined like that. My guess is some compatibility issues. Maybe @fabriciocolombo know something.

jhonatasobrinho commented 8 years ago

Yes. Apparently it's not a bug, but I couldn't access this function. I had to take off the UNDEF USE_SUPER_OBJECT declaration and so, started to work properly.

I don't know why the UNDEF was hit since it was declared on {$IFDEF MACOS} and I'm not in a MacOS by the way. Please @fabriciocolombo, help us! :)

RobertoSchneiders commented 8 years ago

so, you don't have the MACOS directive defined on your project settings? for sure?

jhonatasobrinho commented 8 years ago

Yes, I'm sure!

RobertoSchneiders commented 8 years ago

Weird. That seems to be a problem with your environment.

fabriciocolombo commented 8 years ago

Are you using the latest version? Before #43, SuperObject was not enabled by default for all environments.

jhonatasobrinho commented 8 years ago

I think so. But I'll download it again and try to reach the problem again.