Line compiles in CodeTyphon but not in Lazarus lazarus / 21-General ---------------------------------------------------------------------- fxeconomist · 2024-04-07 19:04 I just ported my project to Lazarus and it failed to compile something interesting. 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 type TCoords3dNum=array [0..2] of extended;             TTriangle3dNum=record                      Points:array[0..2] of TCoords3dNum;                      GroupID,PieceID:longint; //added for convenience                    end;            TMesh=array of TTriangle3dNum;   var meshCube: TMesh; procedure InitMeshes;//for testing purposesvar i,j:integer;begin  SetLength(meshCube, 12);  //SOUTH  meshCube[0].points:=[ [0,0,0], [0,1,0], [1,1,0] ];  meshCube[0].GroupID:=0; The array assignment fails with: Error: incompatible Types: Got "{Array of Const/Constant Open} Array of {Array of Const/Constant Open} Array of Shortint" expected "TTriangle3dNum.Array[0..2] of TCoords3dNum" If I add a .0 to numbers then it says Array of Single. So, what's the catch ? Is there a compiler setting to allow this kind of syntax ? ---------------------------------------------------------------------- PascalDragon · 2024-04-07 19:28 Quote from: fxeconomist on April 07, 2024, 09:04:33 pmSo, what's the catch ? Is there a compiler setting to allow this kind of syntax ? Assignment of array constructors to static arrays is only supported in FPC 3.3.1, but not in the 3.2 series. ---------------------------------------------------------------------- fxeconomist · 2024-04-08 06:26 Can I just change the FPC compiler inside Lazarus ? I don't necessarily need that thing right now, but it's a really neat thing. I coded some OpenScad, and it's pushed to insane levels there. ---------------------------------------------------------------------- Thaddy · 2024-04-08 06:36 No, becauuse Lazarus itself needs to be compiled with that same compiler. ---------------------------------------------------------------------- wp · 2024-04-08 08:00 Quote from: fxeconomist on April 08, 2024, 08:26:14 amCan I just change the FPC compiler inside Lazarus ? If you want to switch to FPC 3.3.1 you check out the current FPC sources from gitlab. Then you build the compiler based on FPC 3.2.2 - there are several posts here or in the wiki on this topic. In "Tools" > "Options" > "Environment" > "Files" under "Compiler executable" you can specify the newly created FPC to be used by Lazarus. Make sure that the entries under "FPC source directory" and "Make executable" point to the correct directories/files for the new FPC. It might also be helpful to run "Tools" > "Rescan FPC source directory" afterwards. Finally you rebuild the IDE with the new compiler under "Tools" > "Configure Build Lazarus": check "Clean All" and "Switch after building to automatically", click "Build" ---------------------------------------------------------------------- PascalDragon · 2024-04-11 20:42 Quote from: Thaddy on April 08, 2024, 08:36:42 amNo, becauuse Lazarus itself needs to be compiled with that same compiler. No, that is not true. It is perfectly valid to use a different compiler than the one the IDE has been compiled with. If one changes the compiler the LCL and related packages will even be recompiled on the fly with the new compiler. ---------------------------------------------------------------------- Thaddy · 2024-04-12 07:36 That is in effect the same thing as I meant. ---------------------------------------------------------------------- wp · 2024-04-12 09:21 Quote from: Thaddy on April 12, 2024, 09:36:21 amThat is in effect the same thing as I meant. But you wrote the opposite: To the question "Can I just change the FPC compiler inside Lazarus ?" you answered "No" ---------------------------------------------------------------------- rvk · 2024-04-12 10:10 Quote from: wp on April 12, 2024, 11:21:11 amQuote from: Thaddy on April 12, 2024, 09:36:21 amThat is in effect the same thing as I meant. But you wrote the opposite: To the question "Can I just change the FPC compiler inside Lazarus ?" you answered "No" From the "because" it's clear that if you compile Lazarus with newer FPC the answer would be yes Quote from: Thaddy on April 08, 2024, 08:36:42 amNo, becauuse Lazarus itself needs to be compiled with that same compiler. Could also be... No Yes, becauuse but Lazarus itself needs to be compiled with that same compiler. It should be noted that using a different FPC compiler, than the one intended for that Lazarus version, can give some unexpected results