[fpc-devel] Embedded Strings on nRF51-DK
Sven Barth
pascaldragon at googlemail.com
Thu Apr 16 19:21:50 CEST 2015
On 16.04.2015 17:50, Paul Michell wrote:
> On Thursday 16 Apr 2015 17:18:21 Sven Barth wrote:
>> How about the unit UARTPutString is defined in? From the missing symbols
>> you quoted earlier the compiler somewhere thinks that it needs to use an
>> AnsiString and thus uses the corresponding functions which the linker the
>> complains about.
>
> Yes that helped; LongStrings were ON in the UART module. When I changed that
> to OFF, the error report changed to:
>
> Main.pas:(.text.n_main_$$_main$$longint+0xa): undefined reference to
> `fpc_shortstr_to_shortstr'
>
> Which suggested to me I needed to link the object containing
> fpc_shortstr_to_shortstr explicitly as I am using the gcc make file.
> After a bit for searching I found the export in system.o which had been
> generated by the embedded compiler. Adding this to the make file resolved the
> the remaining error.
Oh, so you're not letting FPC do the linking? If you'd have said that in
your first mail then I could have told you as well that you need to have
the system.o included.
Alternatively you could also use the option -sh which will generate a
linker script for the host system and adjust that to your needs (though
you'd need to do that every time you compile the units).
This also means that probably AnsiString will also work if you have the
system.o (though maybe you'll also require a memory manager unit; AFAIK
embedded needs an extra unit for that).
Regards,
sven
More information about the fpc-devel
mailing list