Error: Argument cannot be assigned to lazarus / 21-General ---------------------------------------------------------------------- Fred vS · 2021-02-18 23:09 Hello. I have a strange issue. On a project that compiles and works perfectly, adding a unit: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses   mpg123, // adding this  gives that error: Quotemyunit.pas(213,21) Error: Argument cannot be assigned to who pointed to that code of myunit.pas (that gives no problems  before): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i pinteger(dest)^ := round(do1 * $7fffffff);    Both units (myunit and mpg123) have {$mode objfpc}{$h+} Unit mpg123 does not have initialize assigned and there is no call to that unit from myunit (only added in uses section). (Removing  mpg123 from uses section, compilation is ok again...) Why suddenly appears Argument cannot be assigned ? Linux 64 bit. fpc 3.2.0. Thanks. Fre;D ---------------------------------------------------------------------- Blaazen · 2021-02-18 23:42 And units in uses section of mpg123? ---------------------------------------------------------------------- Fred vS · 2021-02-19 00:06 Quote from: Blaazen on February 19, 2021, 12:42:16 amAnd units in uses section of mpg123? Hello Blaazen. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit mpg123; interface {$mode objfpc}{$H+} uses ctypes,  classes, dynlibs; I did already test to add in uses section of myunit each unit (ctypes and dynlibs, classes is already there) and without mpg123 but then it compiles ok. Very strange, also I dont see any var in mpg123 with same name is in myunits. ---------------------------------------------------------------------- Blaazen · 2021-02-19 00:20 Can you try the other debugger? Fpdebug instead gdb (or opposite). ---------------------------------------------------------------------- Fred vS · 2021-02-19 00:38 Quote from: Blaazen on February 19, 2021, 01:20:45 amCan you try the other debugger? Fpdebug instead gdb (or opposite). I think I get something. In mpg123 this is defined: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i PInteger = Pointer; But fpc has also PInteger defined. So doing this in myunit makes confusion with pinteger of mpg123: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i pinteger(dest)^ := round(do1 * $7fffffff); Do you know if there a equivalent to write pinteger(dest)^  (without using pinteger())? Or maybe the code of mpg123 should be different, like for example (and adapt the code): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i PInteg = Pointer; Fre;D ---------------------------------------------------------------------- Fred vS · 2021-02-19 00:43 Re-hello Blaazen. OK, PInteg = Pointer; solves the problem. Sorry for the noise. Fre;D ---------------------------------------------------------------------- Blaazen · 2021-02-19 00:48 You can also specify the unit where it comes from: Objpas.PInteger(Dest)^ ---------------------------------------------------------------------- Fred vS · 2021-02-19 02:10 Quote from: Blaazen on February 19, 2021, 01:48:38 amYou can also specify the unit where it comes from: Objpas.PInteger(Dest)^ Excellent, tested, works like charm. Many thanks. Fre;D