External variable compilation error lazarus / 66-Unix ---------------------------------------------------------------------- Roland57 · 2020-10-29 18:51 Hello! I try to compile a program that I didn't written. I have a problem with thee two lines: 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 var  stdout: pointer; {$ifdef linux}external libc;{$endif}  stdin: pointer; {$ifdef linux}external libc;{$endif} I get this error message, that I don't know how to solve: QuoteuSystem.pas(45,43) Fatal: Syntax error, ":" expected but "identifier LIBC" found Would someone have a suggestion? ---------------------------------------------------------------------- Roland57 · 2020-10-29 19:04 I have just seen that there is an *.inc with this: 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 {$ifdef linux}  const    libc = 'c';    fmt64 = 'll';{$else} ---------------------------------------------------------------------- marcov · 2020-10-29 19:20 look up cvar in the documentation ---------------------------------------------------------------------- Fred vS · 2020-10-29 19:22 Hello Roland. This compiles ok here: 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 program testvar; {$mode objfpc}{$H+} var  stdin: pointer; external 'libc.so.6';  stdout: pointer; external 'libc.so.6';  beginend. ---------------------------------------------------------------------- Roland57 · 2020-10-29 19:39 Quote from: marcov on October 29, 2020, 08:20:50 pmlook up cvar in the documentation Thank you for your answer. I tried this: 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 var  hConsole: THandle;  stdout: pointer; {$ifdef linux}cvar; external libc;{$endif}  stdin: pointer; {$ifdef linux}cvar; external libc;{$endif} and also this: 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 var  hConsole: THandle;  stdout: pointer; {$ifdef linux}cvar; external;{$endif}  stdin: pointer; {$ifdef linux}cvar; external;{$endif} without success. ---------------------------------------------------------------------- Roland57 · 2020-10-29 19:40 Quote from: Fred vS on October 29, 2020, 08:22:19 pmHello Roland. This compiles ok here: 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 program testvar; {$mode objfpc}{$H+} var  stdin: pointer; external 'libc';  stdout: pointer; external 'libc';  beginend. Weird. Here it doesn't compile. Here are my options: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i fpc -FcUTF8 -B -Mobjfpc -Sh -FUunits OpenCritter.dpr -o./critter32 -dDEBUG -ghl ---------------------------------------------------------------------- Fred vS · 2020-10-29 19:46 Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i fred@fiens ~>fpc -B testvar.pas QuoteFree Pascal Compiler version 3.2.1[2020/08/24] for x86_64 Copyright (c) 1993-2020 by Florian Klaempfl & Others. Target OS: Linux for x86-64 Compiling testvar.pas testvar.pas(6,3) Note: Local variable "stdin" not used testvar.pas(7,3) Note: Local variable "stdout" not used Linking testvar 10 lines compiled, 0.1 sec 2 note(s) issued ---------------------------------------------------------------------- Roland57 · 2020-10-29 19:54 OK, Fred, you are right. There was a {$mode delphi } in the head of the file. After I removed it, it compiles. But maybe is it rather: 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 external 'c' ---------------------------------------------------------------------- Fred vS · 2020-10-29 19:59 Quote from: Roland57 on October 29, 2020, 08:54:51 pmBut maybe is it rather: 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 external 'c' If you want, it is the **great** feature of fpc, to auto-add 'lib' prefix (and auto-cut the 'so number'). ;-° Fre;D