Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compiling error

Status
Not open for further replies.

mjcmkrsr

Technical User
Nov 30, 2010
830
Hi,

When compiling a project I get the following error

Visual Class Library c:\users\...\classes\vfp6sp5.vcx has the following errors:
Form NOMSDEMANDES - Undefined
Form AJOUT - Undefined
Form EFFACER - Undefined

How can I determine which CLASS(es) make(s) the calls to these forms?

TIA

MarK
 
It's not necessarily DO FORM calls or CREATEOBJECT('formclass'), it could be some form classes of the defect VCX have the mentioned forms as the parent classes they inherit from.

If you have vcxes with parent classes in other vcxes, you better never rearrange files, they have to be kept in the same relative location.

So look where you got form classes ajout, effacer and nomsdemandes.

Chriss
 
Hi Chriss,

Thanks for the hint. I'll check the dependencies among the different VCX's

MarK
 
You could also do a Code References search for each of the form names. That will show you the code that invokes the relevant forms, and that in turn should give you a clue as to how and where they are created.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike and Chriss,

I used Code References awa GoFish5 but I could not find a solution.

Maybe I have a wrong understanding of what is included in the EXE when compiling a project.

I'll try to explain:

I have one VCX with all my base classes on which I built the classes I use. Among others I have a toolbar base class tlbBase, a tlbOne class and a tlbTwo class, both built on the tlbBase BUT with different code in the buttons. tlbOne makes a call to the form NOMSDEMANDES whereas tlbTwo doesn't. Project_1 instantiates tlbOne and Project_2 instantiates tlbTwo. Now when I compile Project_2, which does not call form NOMSDEMANDES the above mentioned errors are thrown. Am I right in assuming that both classes (tlbOne and tlbTwo) are compiled into the two EXE's - which would explain the errors.

Btw I circumvented the errors by adding empty forms named accordingly to Project_2.

Does this make sense?

TIA

MarK
 
All project items are compiled, no matter if you set them included or not.

Chriss
 
Hi Chriss and Mike,

Thanks - I should have read this topic in the Help file

MarK
 
I don't think this is documented. And it's unexpected. So either you ignore the errors or you remove the classes that error from the projects that don't need them, which means - as far as I got it - you'd need to split the VCX into two.

Chriss
 
Hi Chriss,

ad 1) Yes it is - from the Help file

Specifies that the project be compiled before the executable file is built. All program and format files; form, label, report, and visual class library source code; and stored procedures in databases in the project are compiled.

ad 2) I have been thinking which option to choose (ignoring the thrown errors - splitting the VXC). Finally I decided to add empty forms with the corresponding names to the projects that call those forms. No harm is done and in case they are called nothing happens.

Thank you again

MarK
 
I have mixed experiences with EXTERNAL either still causeing error messages, I think they subtly change from Undefined to Unknown or vice versa, only. Which also establishes the solution that's recoommended or at least known, even for EXTERNAL arrays, to rather define an array or even a function in main.prg with the array name to get rid of the error message in the build process.

In a complex project you surely would like to have a clean result with no error text popping up after the build, but I got used to a set of 2 messages in a larger project. It's easy to detect when an actual build error is added.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top