I am attempting to upgrade one of our applications from D2007 to D2010, and I have run into an issue I am not sure about.
I am attempting to upgrade one of our applications from D2007 to D2010, and I have run into an issue I am not sure about.
Basically, I try to compile and get an Undeclared Identifier error. However, I look and the identifier named as being undeclared is, in fact, declared. It is declared as a protected function of a class. Also, this code compiles just fine under D2007.
A Google search of course returns examples of trying to use variables before they are declared... which I don't think is the case here.
My questions is thus: Does anyone know of any strange issues with updating from D2007 to D2010 that may cause this? I should also probably mention that this is a fairly fresh install of D2010, are there any updates/fixes I have missed that may fix this issue?
I can provide code examples if necessary... however the unit this occurs in is quite large.
Also, I apologize that this is long. Please let me know (kindly) if anything I have posted here is inappropriate for this forum.
Thanks!
Basically, I try to compile and get an Undeclared Identifier error. However, I look and the identifier named as being undeclared is, in fact, declared. It is declared as a protected function of a class. Also, this code compiles just fine under D2007.
A Google search of course returns examples of trying to use variables before they are declared... which I don't think is the case here.
My questions is thus: Does anyone know of any strange issues with updating from D2007 to D2010 that may cause this? I should also probably mention that this is a fairly fresh install of D2010, are there any updates/fixes I have missed that may fix this issue?
I can provide code examples if necessary... however the unit this occurs in is quite large.
Also, I apologize that this is long. Please let me know (kindly) if anything I have posted here is inappropriate for this forum.
Thanks!
P.S. I downloaded IDEFixPack2010Reg54.zip from http://www.delphifeeds.com/go/f/60696 as was recommended from a Stack Overflow issue I found... to no avail
ReplyDeleteIs the reference that the compiler complains about, made outside the class or descendant class in a different unit? Does it compile if you move the declaration to the public section?
ReplyDeleteStay.away.from.Delphi2010. Seriously. Leave it or at least go to XE. Delphi2010 was a broken pile of crap.
ReplyDeleteWhy porting to 2010? You should really port your code to the latest version which currently is Delphi XE5, update 2.
ReplyDeleteAnyway, you should post the relevant code if you want more help. You should also create a very simple sample program reproducing the error you have.
ReplyDeleteLars Fosdal, below is an abbreviated version of what the code looks like.
ReplyDeleteinterface
type
TSvcAlaska = class(TDataAbstractService, ISvcAlaska)
public
{Public Declarations}
private
{Private Declarations}
protected
function wsSysEncryptData(const pi_RAW_TEXT: String): String;
implementation
function TSvcAlaska.wsSysEncryptData(const pi_RAW_TEXT: String): String;
begin
{Really Nifty Code}
end;
I tried moving the function declaration to the public section and got the same result.
Stefan Glienke , Good to know! We actually purchased XE5 this year, however we haven't updated all of our (way too many) 3rd party components yet.
François Piette we bought XE5 this year, but don't have all our components. We do for 2010... however if 2010 is going to be such a problem, I think I might just wait until we get our 3rd party components upgraded... or replace them with what is available in XE5.
ReplyDeleteLooks like FIBPlus doesn't support XE5 yet... that sucks.
ReplyDeleteIf you had the good idea to buy the source code, then you may try to simply recompile it with XE5.
ReplyDeleteOr replace FIBPlus by FireDAC which comes with XE5.
Adam Martin In the code published, where is the compiler error triggered? It is probably when you call wsSysEncryptData and you don't show it. I ask because the code looks OK (missing end but that' surely not the issue.
ReplyDeleteFrançois Piette the compiler error tells me it triggers on this line:
ReplyDeleteTSvcAlaska = class(TDataAbstractService, ISvcAlaska)
Great idea on trying to recompile! We actually did buy the source code. I rather like the idea of switching to FireDAC as I have enjoyed working with it. That would take a while though (could be worth it, will have to evaluate).
Here's the compiler error if it helps.
ReplyDelete[DCC Error] SvcAlaska_Impl.pas(33): E2003 Undeclared identifier: 'wsSysEncryptData'
what's line 33? I only see 17 lines. That's probably the key.
ReplyDeleteLine 33 is the line I posted earlier. The code I posted is abbreviated as the entire unit is 3387 lines.
ReplyDeleteHere it is again:
(33) TSvcAlaska = class(TDataAbstractService, ISvcAlaska)
I don't see an "end" before the "implementation". Maybe that's just abbreviated?
ReplyDeleteIt is yes, sorry!
ReplyDeleteI think the takeaway from all this is, don't use D2010. Thank you all for your comments! I apologize if I was unclear! I'm new at this, I'll get better!
ReplyDelete