views:

349

answers:

3

Hi,

I'm using Delphi 2010 to create a SOAP Server. The server is created as a ISAPI/NSAPI DLL. I then add an interface with some sample methods.

If I try and build this project I get this compiler error:

Building Project1.dproj (Debug configuration) [DCC Fatal Error] Unit1.pas(6): F2063 Could not compile used unit 'msxml.pas' Failed Elapsed time: 00:00:01.5

Where should I start looking to resolve this issue?

Regards AJ

+3  A: 

Msxml.pas is a unit included with Delphi. You shouldn't need to compile it yourself, so make sure you haven't added that source file to your project. Delphi will use the DCU file that Embarcadero shipped with the compiler. Also make sure you haven't added $(DELPHI)\Source to Delphi's search path, or else Delphi may try to recompile it for you.

Rob Kennedy
What's wrong with recompiling a file? It should work just fine. And it clearly works for msxml.pas on Delphi 2010, I just tried it.
Cosmin Prund
Recompiling a Delphi-provided unit can lead to Delphi trying to recompile other units (because they're now out of date compared to the newly compiled unit). That eventually leads to Delphi trying to recompile special units like System or Variants, or complaints from the compiler that a unit was compiled with a different version of some type. It's best not to recompile the things that were already compiled for you, @Cosmin.
Rob Kennedy
A: 

looks like you have added it in one of the paths by mistake or the program has, just remove it and you should be fine

Jonathan D
+2  A: 

Your error message is strange, because as Rob Kennedy says, that message is usually an summary message that's displayed after an number of other, more specific messages. I've NEVER seen it all by itself. Also the msxml.pas file is provided by Delphi and I've never seen a Delphi-provided unit that doesn't compile. (And I did make a test on my Delphi 2010, msxml.pas does compile fine). Ignore the messages asking you to remove the .pas file from your search path or from your project, that can't possibly help because the .pas file itself is ok and compiles just fine. Your problem is deeper.

Here's what I suspect: Some of your Delphi-provided DCU files somehow became corrupted. It might be the actual msxml.dcu file, but it might as well be a DCU file required by msxml.dcu!

Debugging steps:

  • Add the msxml.pas file to your project and "build" (not compile). If not fixed, and you get the same error message, move on...
  • Go into the msxml.pas file, look at the "uses" clauses and add all files to your project (move your over the name of the unit and hit CTRL + Enter and once the file opened hit the "add to project button"). Rebuild. This should be enough! If you still get similar nonsense error messages then move on:
  • Try the same on an new project. If it works then you know it's something related to your other project's settings (search path most likeley, possibly some defined symbols). If it doesn't work on the new project, even after adding the whole bunch of files tot he project, it's probably time to uninstall and reisntall Delphi. I'm only suggesting an uninstall/reinstall because I'm 95% sure it's a file corruption issue.
Cosmin Prund
Thanks a lot Cosmin, Adding the file to the msxml.pas file to the project worked. After the build I removed the file from the project and tried to compile again and it still works. So your suggestion worked. Thanks again. AJ
AJ