[Lazarus] FPC 2.7.1 and console output
Mattias Gaertner
nc-gaertnma at netcologne.de
Wed Dec 3 12:14:30 CET 2014
On Tue, 02 Dec 2014 22:41:04 +0100
Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:
> Mattias Gaertner schrieb:
>[...]
> I wrote my first test programs with NotePad, and called FPC from the
> commandline. These files also compile okay with Lazarus, when loaded as
> projects.
Ok. If they create different output, please post the different
command line parameters.
> Next I tried FP, but couldn't figure out how to configure it at all, for
> using the trunk compiler :-(
Do you mean in Lazarus?
In Lazarus 1.2 you set it in Tools / Options / Files
In Lazarus 1.3 you could set it global as above or for each project in
Project Options / Compiler Options / Paths.
> Finally I managed to build Lazarus trunk, and that's where I'm now.
Great.
> When creating a project in Lazarus, the default file encoding (now?)
> seems to be UTF-8 without BOM, at least I had no problems with older
> versions - maybe because I only used ASCII in my programs, and rarely
> wrote console programs.
True.
> So how can I convince Lazarus to use (and assume) source files of my
> (non-VCL) projects being Windows codepage (1252)?
There is no option to change the default codepage of new files.
But you can change the encoding easily: Right click on source editor /
File Settings / Encoding / CP1252.
> > You can see what parameters the IDE passed to the compiler. Right click
> > on the messages (e.g. the "Compile Project..."), then "About Compiler
> > Project...".
>
> Then I need an wizard that explains me the consequences of (not) using
> any possible switch :-(
The lists and forums have this wizard power.
> > Have you set any flags in the "Configure Build Lazarus" dialog?
>
> Not yet, I had a hard time until I could build and configure the current
> Lazarus trunk version. It looks to me as if the last FPC *release*
> version is required to build Lazarus,
No.
2.6.4 is guaranteed to work.
2.7.1 is a moving target, but we try hard to support it.
>[...]
> > What do you mean with "string output"?
>
> WriteLn to the console.
Beware that if you want to test string encoding, console is deceiving.
Input and output.
You can use your current codepage as source encoding, or use UTF-8
sources and function UTF8ToConsole for x-platform. The latter is
does not magically extend the limitations of the console, but at
least other people can read your sources and you can use your code
with the LCL.
Mattias
More information about the Lazarus
mailing list