I always get "Fatal: Compilation aborted" error the first time, ... lazarus / 67-Windows ---------------------------------------------------------------------- markus_ja · 2016-06-17 09:18 Hello, since today, I always get an "Fatal: Compilation aborted" error, when I compile my project after I did some changes. When I "re-compile" the project, it compiles fine. The last days it was just randomly, but since today it's always. Does anybody know, what the issue is here. I use generics in delphi mode, maybe that is the issue? I remember when CodeGear/Emb introduced generics/closuers I had a similar problem. Lazarus 1.6 Win7 + 64Bit ---------------------------------------------------------------------- Thaddy · 2016-06-17 09:34 Quote from: markus_ja on June 17, 2016, 11:18:11 am I remember when CodeGear/Emb introduced generics/closuers I had a similar problem. Well then, give us some code that reproduces the issue. If you had similar issues with Delphi, chances are your code "doesn't meet standards"  . ---------------------------------------------------------------------- markus_ja · 2016-06-17 09:43 I will try to isolate the issue. I also use ZeosLib and mORMot in my project. ---------------------------------------------------------------------- Martin_fr · 2016-06-17 11:06 right click the message window, and get ALL and Hidden messages. That may give more info on the error ---------------------------------------------------------------------- markus_ja · 2016-06-17 11:15 These are the messages, but don't see any hint, for that issue: Nachrichten, Hinweise: 154 Note: Duplicate unit "ZSybaseToken" in "zcore 7.1", orphaned ppu "C:\D evelopment\lazarus_external_lib\ZeosLib\packages\lazarus\lib\x86_64- win64\ZSybaseToken.ppu" ... Projekt kompilieren, Ziel: _bin\x86_64-win64\DbSrvForm.exe: Exit code 1, Fehler: 1, Hinweise: 2 Hint: Start of reading config file C:\Development\lazarus\fpc\3.0.0\bin\x86_64-win64\fpc.cfg Hint: End of reading config file C:\Development\lazarus\fpc\3.0.0\bin\x86_64-win64\fpc.cfg Verbose: Free Pascal Compiler version 3.0.0 [2016/02/14] for x86_64 Verbose: Target OS: Win64 for x64 Verbose: Compiling DbSrvForm.lpr Fatal: Compilation aborted Verbose: C:\Development\lazarus\fpc\3.0.0\bin\x86_64-win64\ppcx64.exe returned an error exitcode I also tried to use my delphi mode generic code in a new project, but there it works fine. The only thing I recognized is, that in the project where the error occuers, the compiler doesn't complain when I use my generic class the delphi way without declaring that unit as {$mode delphi}. e.g.: var   x: TSimpleDict; //compiles without {$mode delphi} But adding that compiler mode, doesn't change anything. ---------------------------------------------------------------------- markus_ja · 2016-06-17 12:14 I added some more code lines (proceeded with my work), and now the fatal error is gone. Strange ---------------------------------------------------------------------- chentung · 2017-04-20 03:16 my condition:   if I set the default vale of one var parameter , like this :     function   xSelectSQL( _sql: string; var _ErrMsg:String=''):Boolean;   then Compilation aborted . ---------------------------------------------------------------------- Martin_fr · 2017-04-20 14:44 When you get the error: copy All/original ... See image (scroll image right) ---------------------------------------------------------------------- chentung · 2017-04-20 14:59 Martin_fr :  Thanks ! that really describe what happened . ---------------------------------------------------------------------- Martin_fr · 2017-04-20 17:55 So what error did you get then? ---------------------------------------------------------------------- chentung · 2017-04-21 13:38 --------------------------------------------------------------------- Hint: (11030) Start of reading config file C:\lazarus164\fpc\3.0.2\bin\i386-win32\fpc.cfg Hint: (11031) End of reading config file C:\lazarus164\fpc\3.0.2\bin\i386-win32\fpc.cfg Free Pascal Compiler version 3.0.2 [2017/02/27] for i386 Copyright (c) 1993-2017 by Florian Klaempfl and others (1002) Target OS: Win32 for i386 (3104) Compiling ct.pas (3104) Compiling sTable.pas C:\lazarus164\L1\sTable.pas(212,69) Error: (3337) Default values can only be specified for value, const and constref parameters C:\lazarus164\L1\sTable.pas(408,1) Fatal: (10026) There were 1 errors compiling module, stopping Fatal: (1018) Compilation aborted Error: C:\lazarus164\fpc\3.0.2\bin\i386-win32\ppc386.exe returned an error exitcode ----------------------------------------------- I set default value to a var parameter ! ---------------------------------------------------------------------- Leledumbo · 2017-04-23 03:51 Quote from: chentung on April 21, 2017, 03:38:00 pmC:\lazarus164\L1\sTable.pas(212,69) Error: (3337) Default values can only be specified for value, const and constref parameters ----------------------------------------------- I set default value to a var parameter ! The error message clearly doesn't mention var parameters and that is logical (it's passed by reference, default value conceptually doesn't have memory address to be passed as reference). ---------------------------------------------------------------------- chentung · 2017-04-24 07:41 Thanks ! hu !  so I see . it's a reference, a memory address, can't be initialized .