1,549 questions
-1
votes
0
answers
84
views
How do I get 'glUseProgram' in a public procedure of a class to access a public variable instead of throwing up an ACCESS VIOLATION error? (Lazarus)
I have gotten a pretty good grasp on how to do many of the things the LearnOpenGL website teaches in Free Pascal, but my learning got halted by an error I have been trying to fix.
See, I am at the ...
0
votes
0
answers
106
views
How to do 'gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)' in FreePascal?
I am attempting to follow along the LearnOpenGL tutorial using Free Pascal (via the Lazarus IDE) and so far I managed to figure out translating most of the code... except for:
gladLoadGLLoader((...
1
vote
1
answer
147
views
Unable to Break in Try-Except block
Today I tried to run this in Pascal Script (using Lazarus):
for I := 0 to 10 do
begin;
try
Writeln(IntToStr(I));
K := 2;
J := K / I;
except
Writeln('error');
...
0
votes
1
answer
138
views
How the Lazarus-IDE manages the TForm.OnCreate event for auto-created forms?
My first question was: "How to assign the TForm.OnCreate event by code in Lazarus?"
But in the process of writing it I changed to: "How the Lazarus-IDE manages the TForm.OnCreate event ...
1
vote
1
answer
52
views
Ranged subtype `Default` intrinsic is outside subtype's declared range
While working on a tiny generic metaprogramming library (runtime contracts/preconditions) I've stumbled upon the following peculiarity:
program GenericCTBooleanFlags;
{$mode objfpc}
type
TFalse = ...
1
vote
1
answer
263
views
Project raised exception class 'External: SIGSEGV' with blank Lazarus App
I see that other people have gotten similar errors in both Delphi (#1, #2) and Lazarus (#1, #2, #3, #4) on StackOverflow, but none of them have it using just a new blank app.
I have a completely brand ...
0
votes
1
answer
52
views
Free Pascal dylib exports with name clauses not findable via dlsym on macOS
I'm creating a Free Pascal dynamic library (.dylib) on macOS that works on Windows but fails to load symbols on macOS. The symbols appear in the symbol table when checked with nm, but dlsym cannot ...
1
vote
1
answer
132
views
Can't run fppkg on macOS: Could not initialize OpenSSL library
I'm on Mac M2 (macOS 15.4) with FPC 3.2.2 installed via Homebrew.
Running fppkg list gave this error:
Warning: Could not initialize OpenSSL library
Name Installed Available
I ...
3
votes
1
answer
127
views
Why doesn’t rounding work outside of range?
Why does rounding not work if I try to compile following code using the FreePascal Compiler?
program RangeCheckError;
var
result: integer;
begin
result := round(1.6514384080961258e+21);
...
1
vote
0
answers
130
views
Creating self‐signed certificates using LibCrypto-3.dll from OpenSSL, code in FreePascal
I’m having trouble with the x509_sign function in the following code.
The error I get from LibCrypto via ERR_print_errors_fp is:
OPENSSL_Uplink(721B6200,08): no OPENSSL_Applink"
program ...
0
votes
1
answer
195
views
How to block WriteLn() in DLL?
I have a DLL (from the libJasPer project). While decoding an image via jas_image_decode() in my console application the DLL shows a warning on STDOUT.
I looked in JasPer on how to disable warnings but ...
1
vote
0
answers
231
views
How to start making Free Pascal projects in VSCode with OmniPascal
I want to create a new FPC project in VSCode. I had read that I need the OmniPascal extension. I installed it. But what to do next? I can't find instructions on finishing the configuration and ...
0
votes
1
answer
125
views
value of iteration variable after FOR loops in FPC
When working with FPC 3.2.3 (Lazarus 4.0 RC1) I noticed that the variable handling in for loops does not work as expected:
procedure TMainForm.ButtonClick(Sender:TObject);
var i:integer;
begin
for i:...
3
votes
1
answer
179
views
Mod operator in Free Pascal gives a different result than expected
The mod operator in Free Pascal does not produce the results I would expect.
This can be demonstrated by the program below whose output does not agree with the result of the same calculation in Python ...
1
vote
1
answer
129
views
Which type is the portable equivalent to the C type FILE in FreePascal
I have to write a wrapper for the C-API of the library GDAL to generate FreePascal bindings under Debian 12 and GDAL version 3.2.2.
One of the functions is:
void CPL_DLL OGR_G_DumpReadable( ...