Author Topic: Issue rebuilding Lazarus with FPC_OS_UNICODE enabled  (Read 262 times)

kopernikus

  • Newbie
  • Posts: 2
Issue rebuilding Lazarus with FPC_OS_UNICODE enabled
« on: September 18, 2026, 12:04:43 pm »
Lazarus 4.8, FPC-Version 3.2.2

Steps to reproduce:
configure "Build Lazarus"
LCL widget type: win32/win64
Define: FPC_OS_UNICODE (enabled)
click on "Build"

Compiler error messages (all concerning to TResourceType):
Quote
...
Compile package LCLBase 4.8: Exit code 1, Errors: 6
graphic.inc(43,13) Error: Incompatible types: got "PChar" expected "PWideChar"
graphic.inc(155,66) Error: Incompatible type for arg no. 3: Got "PWideChar", expected "PChar"
graphic.inc(171,62) Error: Incompatible type for arg no. 3: Got "PWideChar", expected "PChar"
icon.inc(1382,13) Error: Incompatible types: got "PChar" expected "PWideChar"
cursorimage.inc(55,13) Error: Incompatible types: got "PChar" expected "PWideChar"
bitmap.inc(118,13) Error: Incompatible types: got "PChar" expected "PWideChar"
...

Zvoni

  • Hero Member
  • *****
  • Posts: 3603
Re: Issue rebuilding Lazarus with FPC_OS_UNICODE enabled
« Reply #1 on: September 18, 2026, 01:14:52 pm »
Open an Issue in the Lazarus-Bugtracker (see left pane of Forum) --> Not the Freepascal-Bugtracker
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Thaddy

  • Hero Member
  • *****
  • Posts: 19978
  • Pointless static linking author
Re: Issue rebuilding Lazarus with FPC_OS_UNICODE enabled
« Reply #2 on: September 18, 2026, 02:48:29 pm »
"Define: FPC_OS_UNICODE (enabled)"
defines Unicode16, not Utf8....
I don't even know if you can build the Lazarus IDE for Unicode16 (You can build the Freepascal RTL, though)
The errors seem correct.... any issue may be dismissed for that reason.
« Last Edit: September 18, 2026, 02:55:25 pm by Thaddy »
Any "programmer" that knows only one programming language is not a programmer

kopernikus

  • Newbie
  • Posts: 2
Re: Issue rebuilding Lazarus with FPC_OS_UNICODE enabled
« Reply #3 on: September 18, 2026, 05:48:33 pm »
Unicode 16  is intended to provide access to the Windows W-API functions (just as is the case in Delphi).

Thaddy

  • Hero Member
  • *****
  • Posts: 19978
  • Pointless static linking author
Re: Issue rebuilding Lazarus with FPC_OS_UNICODE enabled
« Reply #4 on: September 18, 2026, 05:55:35 pm »
That is not needed, UTF8 will use the W versions.
Any "programmer" that knows only one programming language is not a programmer

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 13052
  • FPC developer.
Re: Issue rebuilding Lazarus with FPC_OS_UNICODE enabled
« Reply #5 on: September 19, 2026, 03:35:17 pm »
Unicode 16  is intended to provide access to the Windows W-API functions (just as is the case in Delphi).

As Thaddy says, it is for Delphi/unicode compatibility.  FPC supports the unicodestring type also in cases where it isn't the default string type.

When passing it to the API it just needs a bit more attention. Specially implicit ansistring<->unicodestring conversions can trip you up, unless you use one of the methods to make the default string type utf8.

 

TinyPortal © 2005-2018