Searching \ for 'Another plea for help' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=another+plea+help
Search entire site for: 'Another plea for help'.

Truncated match.
PICList Thread
'Another plea for help'
1999\08\28@204709 by Steve Thackery

flavicon
face
Sorry guys, but I'm still struggling with something that is presumably
incredibly simple.  In fact it's driving me completely mad.  I really would
appreciate it if someone could shed some light on this as I'm totally
stumped.

I'm running NT4, and I wonder if this may have something to do with the
mystery.

I've got MPLAB 4.12 and have installed C17 as well.  MPLAB is installed on
my main NT drive, which is E:, in the following directory:
E:\PROGFILE\MPLAB.  I've tried installing MCC in various places, including
the E: drive, and currently it's on my old DOS drive in C:\MCC.

I'm working through the demo in the Compiler User's Guide in section 2.7.
Basically this involves combining a .c file, four .o files, and a .lkr file.
I've followed the instructions to the letter, and when I come to build the
project here is what happens.....

------------------------------------------
Building AD.HEX...

Compiling AD.C:
Command line: "C:\mcc\bin\mcc17.exe /w2 /Ms /p=17C756 /iC:\MCC\H\
C:\MCC\EXAMPLES\AD\AD.C"
MPLAB-C17 v2.30 Copyright 1997, 1998 Microchip Technology Inc.
Errors:    0
Warnings:  0

Linking:
Command line: "E:\PROGFILE\MPLAB\MPLINK.EXE /o AD.HEX /l C:\MCC\LIB  /k
C:\MCC\EXAMPLES\AD\; C:\MCC\EXAMPLES\AD\AD.O C:\MCC\LIB\C0S17.O
C:\MCC\LIB\IDATA17.O C:\MCC\LIB\INT756L.O C:\MCC\LIB\P17C756.O
C:\MCC\EXAMPLES\AD\P17C756L.LKR "

MPLAB is unable to find output file "AD.HEX".

Build failed.
------------------------------------------

The compiler is seemingly working fine, and I can see the AD.O file that it
generates.  The problem apparently arises with the linker.  Whatever is
going wrong, I can confirm that the linker does *not* generate the AD.HEX
file.

But here is some weird shit: I start up a command prompt, and 'cd' to the
C:\MCC\EXAMPLES\AD directory, where my 'C' source file is.  So the command
prompt looks like this:

C:\mcc\examples\ad

OK, so I'm in the directory where my ad.c and ad.o files are.  I can do a
dir and see them.  Nothing weird so far.

I then type in the linker command line *exactly* as shown in the list out
above (without the quotation marks) - in fact I cut and paste it to be
sure - and the linker works fine and generates the AD.HEX file!!

In other words, it works from the command prompt but not from within MPLAB.
Even more weird: if I attempt a build again from within MPLAB, it *still*
says "unable to find output file AD.HEX" even though that file is now
sitting there quite happily in the C:\mcc\examples\ad directory.

Even better: if I import the HEX file into MPLAB I can single step through
it and everything.  In other words it behaves like a successful build.  But
I can't build the damn thing from inside MPLAB.

It's a major hassle having to go out to the command line each time I want to
do a build, and I cannot believe it's necessary.  I must be doing something
wrong that's so simple it's staring me in the face, but I'm damned if I can
spot it.

Can any of you give me some pointers before I go completely mad?  I still
half wonder if this is some subtle incompatibility with NT4.  Do any of you
use NT4?

Oh yes: here are the lines from my "Edit Project" dialogue box:

Target Filename: ad.hex
Include Path: c:\mcc\h
Library Path: c:\mcc\lib
Linker Script Path: c:\mcc\examples\ad

Many thanks in anticipation!

Steve

Steve Thackery
Suffolk, England.
Web Site: http://www.btinternet.com/~stevethack/

1999\08\28@215024 by Bob Drzyzgula

flavicon
face
On Sun, Aug 29, 1999 at 01:44:28AM +0100, Steve Thackery wrote:
>
> Command line: "E:\PROGFILE\MPLAB\MPLINK.EXE /o AD.HEX /l C:\MCC\LIB  /k
> C:\MCC\EXAMPLES\AD\; C:\MCC\EXAMPLES\AD\AD.O C:\MCC\LIB\C0S17.O
> C:\MCC\LIB\IDATA17.O C:\MCC\LIB\INT756L.O C:\MCC\LIB\P17C756.O
> C:\MCC\EXAMPLES\AD\P17C756L.LKR "

This all looks to me like a classic current directory
problem. Note that, in the above, "AD.HEX" is the only
file for which no absolute path is specified.

Dollars to doughnuts you've got a file "AD.HEX" sitting
on one of your hard drives somewhere that you don't
expect. Try using WinNT's Find File function in Windows
Explorer, have it look for files named "AD.HEX" on
"all local hard drives". I bet you'll find at least
two, the one you created from the command line, and
the one that was created by MPLAB; the one that isn't
where you expect would be where the current directory
is for the MPLINK command out of MPLAB.  MPLAB probably
has a different concept of the current directory than
MPLINK, thus causing the conflict.

I could be wrong, but it's something to try anyway.

--Bob

--
============================================================
Bob Drzyzgula                             It's not a problem
spam_OUTbobTakeThisOuTspamdrzyzgula.org                until something bad happens
============================================================

1999\08\28@224947 by Dan Creagan

flavicon
face
I've also run into this problem when the current path to the
linker/assembler isn't in the environment. With NT I believe that is set in
the Control Panel/System Icon/Environment tab. Add the path to MPLAB by
extending the PATH variable.

It doesn't matter if MPLAB knows about the compiler if the compiler doesn't
know about MPLAB and can't find the MPASM stuff.  I think some (all?)
compilers spawn another process to assemble, thus leaving MPLAB out of the
loop.

But as Bob said ... I could be wrong... etc..

Dan
{Original Message removed}

1999\08\29@080338 by Steve Thackery

flavicon
face
Many thanks to those who've offered help.  It still isn't fixed, but I'm
making progress.  Just as a reminder, here is the linker command line (the
project and source files are AD.*):

Linking:
Command line: "E:\PROGFILE\MPLAB\MPLINK.EXE /o AD.HEX /l C:\MCC\LIB  /k
C:\MCC\EXAMPLES\AD AD.O C:\MCC\LIB\C0S17.O C:\MCC\LIB\IDATA17.O
C:\MCC\LIB\INT756L.O C:\MCC\LIB\P17C756.O P17C756L.LKR "

Bob was almost right when he wrote the following, and he put me on the right
track:

> This all looks to me like a classic current directory
> problem. Note that, in the above, "AD.HEX" is the only
> file for which no absolute path is specified.

In fact, the problem isn't with the AD.HEX file, it's with the AD.O file.
The compiler gets told the full path to the AD.C source file, finds it and
generates the AD.O file in the same directory.  But the linker *doesn't get
told the full path to the AD.O file*.  If you look at the command line
above, you will see the object file (just after the /k directive) is simply
listed as AD.O.

As far as I'm concerned this is a bug in MPLAB.  It should give the full
path of the object file to the linker, in the same way as it gives the full
path of the source file to the compiler.

As far as I can tell, the linker regards the "current directory" as the
MPLAB directory (e:\progfile\mplab\).  If I start a command prompt, set the
current directory to the MPLAB directory and type the command line shown
above, the linker fails with:

Error - could not find file 'AD.O'.

BUT, I can do two things to make the build work.  The first method is to
'cd' to the directory which contains AD.O, repeat the command line and it
all works.  In other words, I make the "current directory" the one which
contains the AD.O file.  The second approach is to stay in the MPLAB
directory and modify the above command line to give the full path to the
AD.O file.  Again, it works.

Trouble is, both of these need me to work from the command line, which I
want to avoid.  That's why I got MPLAB, after all.

It seems to boil down to two options, neither of which I know how to do.  I
need to modify MPLAB so it gives the linker the full path to the .O file.
Or I need to change what the linker regards as the "current directory".  And
now I'm flummoxed again!!  Any ideas, anyone?

Oh, by the way, I have added all the MPLAB and MCC directories to the path,
and even the directory containing the AD.O file, but it hasn't helped.  The
linker apparently won't search the path for the object file.

At risk of sounding like a stuck record, I really do appreciate all the help
you are giving.  I hope I can do the same in return someday.

Best wishes to all,

Steve

Steve Thackery
Suffolk, England.
Web Site: http://www.btinternet.com/~stevethack/

1999\08\29@180532 by Graeme Smith

flavicon
face
I disremember getting a similar error.

I can't offhand think of how I got around it, but it has something to do
with setting up the MPLAB environment differently.

I think there is a menu entry I was able to apply to the problem once I
figured out that it was looking in the wrong directory for my objects.

Um, the way I remember it, the menu entry was NOT in the project menu,
I think it was further to the left... but don't quote me.

The annoying part of this error... which I had in MPLAB 4.0 is that it
would completely disregard the changes I made in the project menu...
Quite annoying actually.

                               GREY

GRAEME SMITH                         email: .....grysmithKILLspamspam@spam@freenet.edmonton.ab.ca
YMCA Edmonton

Address has changed with little warning!
(I moved across the hall! :) )

Email will remain constant... at least for now.


On Sun, 29 Aug 1999, Steve Thackery wrote:

{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...