I have been using MPLAB since version 6. However! Not with C... But I'm sure I was using C18 version 3.32 on MPLAB 7.62... I never had these issues... I still think the installation went south somewhere.... Pic18f452 was supported back at version 7.62 as this was the chip I always used... ( I use 4520 now ). So I don't think it's a version fault, nor do I think the OS is to blame.. 98 was pretty stable.....
I still think its a "path" issue!
Well, I can only refer you to the complete path listings that I gave in an earlier message in this thread. If you can see the problem there, please do let me know.
I'm certainly not blaming win '98 - that was actually a separate issue, in which MPLAB V8.66 ran unbearably slowly on the same win '98 machine which runs V8.00 very nicely. That is forcing me to use an old version of MPLAB which clearly does not want to work well with C18. Incidentally this is not only happening on the '98 machine I've been talking about - If I repeat everything I've already told you I've tried there on this machine, which is XP, I get exactly the same results / error. The common factors are the same version of MPLAB and the same version of C18. The two machines are twelve miles apart.
MPLAB has just become too unwieldy for '98 to be able to run it, which is not '98s fault. (In fact, official MPLAB supoport for '98 ended some time before V8.00. After that , it was a case of 'we don't guarantee that it works') I loved 98SE - I resisted every effort to kick me off it and was still using it for some time after MS discontinued all support for it. Only eventually did I move on to XP, which by then had been debugged to the extent that it was as stable as 98 SE eventually was... and now I'm still using XP.
Anyway, I have another XP machine hitherto untouched by MPLAB, and this evening I downloaded the current version of MPLAB (8.86) onto that, installed it and then immediately afterwards downloaded and installed the current version of C18, which in fact turned out to be V3.42, the version I have been trying to use all along.
I did as you did - created a project - added leds.c to it, and simply built it and it built successfully. All paths for the the toolsuite were already correctly set up without any intervention from me - and, just as you suggested, I did not need to add the linker script to the project myself - it was obviously found automatically on the basis of the processor specified in the project. The project contains nothing but the 'c' file, but compiles and links without any problem.
This is the way the other version should have worked all along.
What I can now do is look at the detail of the syntax which MPLAB V8.86 passes to the compiler and linker and see how that differs from that passed to them by V8.00, if at all. On the 98 machine, I can try opening a DOS window and running the compiler and linker from a command line using the exact parameters which MPLAB v8.86 passes to them on the XP machine, to see if it then works.
I'll let you know what happens.