On 16 Jun, Theo wrote in message
<Coy*
RG...@news.chiark.greenend.org.uk>:
> Steve Fryatt <
ne...@stevefryatt.org.uk> wrote:
>
> > One oddity is that it seems to include an Error.c source file which GCC
> > thinks duplicates the Error.c in DeskLib. This appears to be to allow
> > WinEd to set its own error box titles, but there seems to be no way to
> > get the linker to pick WinEd's Error.o over the one in DeskLib (although
> > the DeskLib notes suggest that this is what should be done).
>
> I'm a bit puzzled by that - normally linking is done on a per-function
> basis, rather than a per-file basis. In other words you might have foo.o
> twice but if the functions don't overlap it's not a problem.
>
> I assume you're doing -lDeskLib rather than trying to link all the *.o
> from Desklib? Where does it talk about this in the Desklib notes?
Yes, that's what I thought... The Error.h in DeskLib says
: This header provides centralised error reporting routines, and a few
: macros to help with error reporting.
: This idea is that if you want to replace these with your own error
: reporting routines you can just link against your set instead and keep the
: function prototypes the same. An example of this is linking against
: Desklib:o.Other.SmError which provides command-line output of errors by
: writing them to stderr.
Then WinEd has its own Error.c file, which contains duplicates of some of
the routines defined in DeskLib's Error.c and Error.h, which appear to do
most of the same things in different ways.
> The other thing I'd try is changing the order on the link line so that it
> detects the right one first.
The Makefile does
linkflags = -mlibscl -o ../!RunImage,ff8
libraries = -L$(GCCSDK_INSTALL_ENV)/lib -lDesk-scl -lFlexLib32
# Default rule
../!RunImage,ff8 : $(objects)
$(CC) $(linkflags) $(objects) $(libraries)
The order of $(objects) $(libraries) in the parameter list just affects
which of the two definitions GCC reports as being the original. $(objects)
contains the Error.o from WinEd, amongst the other WinEd object files.
> > Also, the version of WinEd in SVN reports itself to be 3.21a, so
> > presumably there are some other code mods that never made it into SVN.
>
> If anyone wants commit access to SVN to tidy things up, I'm happy to
> arrange that...
It might be useful... :-)
I've already got access to the Tokenize repo, although it's been a while
since I used it.