Questions tagged [fpc]

FPC (Free Pascal Compiler) is a 32/64-bit multi-architecture Object Pascal compiler with both Turbo Pascal, Apple Pascal and Delphi dialects.

FPC (Free Pascal Compiler) is a 16/32/64-bit multi-architecture Object Pascal compiler with both Turbo Pascal, Apple Pascal and Delphi dialects.

Free Pascal is the compiler core under the Lazarus RAD project, which provides a portable Delphi-like IDE and RAD. Lazarus has its own tag on Stackoverflow.

However Free Pascal is used directly for server/web/control apps too.

Free Pascal currently supports x86/x86_64, powerpc/powerpc64, sparc and assorted ARMs, and most popular OSes.

8086 (16-bit x86), m68k and Mips are in advanced stages of preparation in the development branch.

164 questions
1
vote
0 answers

Indy IdIRC - does not Join a Chat Room

I want to join an IRC room, using TIdIRC + Lazarus. I am familair with this discussion. This is my code : procedure TForm1.Button4Click(Sender: TObject); begin if Edit3.Text = '' then begin log('ERROR : Nick unknown, specify a Nick (look…
Sean
  • 789
  • 6
  • 26
1
vote
1 answer

Crt library changes console encoding, pascal

I generated a table into console and it went great but when i add "uses crt;", the labels, lines etc. which I made using chr(ord.value); , and also language special characters go wild, so I guess it somehow changes encoding. I work in Win7,FPC IDE…
Marek Židek
  • 809
  • 1
  • 15
  • 31
1
vote
0 answers

Why am I getting an incorrect array size from lazarus?

I have an array that is being created by parsing a semi-colon delimited list. The splitting of the string into an array works and if I use a for-in and display each element I get the correct results. procedure badSizeOfDemo(arrayString:…
Fat Monk
  • 2,077
  • 1
  • 26
  • 59
1
vote
1 answer

Static linking against the indigo cheminformatics package under Linux x64 complains undefined reference to __dso_handle when Free Pascal is used

Update 1 According to this SO post, Free Pascal may not link against C++ object file, which means static C++ libraries, when libstdc++.so.6.X is used as the C++ lib. It should be noted that for that specific hello-world program in that SO post,…
SOUser
  • 3,802
  • 5
  • 33
  • 63
1
vote
1 answer

FPC Whole Program Optimization

How can I use Whole Program Optimization feature in Free Pascal 2.7.1 on Windows? I get this error: Project1.dpr(92,1) Fatal: Cannot find "nm.exe" or "" to extract symbol liveness information from linked program
user3060326
  • 187
  • 2
  • 16
1
vote
2 answers

Help me with a solution for what could be solutioned by virtual static fields... in FPC

I'm doing an event manager in Freepascal Each event is an object type TEvent (=object), each kind of event must derive from this class. Events are differentiated by an integer identificator, assigned dynamically. The problem is that i want to…
1
vote
1 answer

Restricted Function with fpc using libsandbox?

I'm making an online-judge program base on PHP and the problem is when i try to add pascal language, it's always RF. I using libsandbox and framework Yii to make it, I've read many topics about Restricted function and about Free-pascal but nothing…
koaidien
  • 11
  • 3
1
vote
2 answers

Create a statically linkable library in Freepascal

I am planning to write a library in FPC that can be linked to from other compilers. Dynamic linking (.so, .dll) is no issue, however, the requirement of static linking from (at least) gcc and/or clang has come up. Somehow, in the end, I need an…
Martok
  • 106
  • 1
  • 8
1
vote
2 answers

Exporting overloaded functions with fpc

I need to create a dll within fpc (delphi-mode). It works fine - but for some reasons, I want to do something (in a unit) like function doSomeThing(a:type1):type2;stdcall; function doSomeThing(a:type3):type4;stdcall; and in the library (for…
Bastian Ebeling
  • 1,138
  • 11
  • 38
1
vote
2 answers

Strings between FPC & Delphi

I am having problems getting length of String in Delphi from an FPC DLL. Which is weird because I can get the String back from the DLL but I can't get its length. Delphi: program Project2; {$APPTYPE CONSOLE} {$R *.res} uses …
user3060326
  • 187
  • 2
  • 16
1
vote
1 answer

How to repeat the procedure of a button

I have developed two procedures of two buttons to for task 1 and task 2. Do you know how to create the new button which can repeat the procedures of two previous buttons to perform task 1 + 2 in assigned number of times ?
HD Ly
  • 45
  • 2
  • 5
1
vote
2 answers

Take a screenshot of a particular area

I am using Lazarus and I have a TImage inside a form. The black table is a TImage and the numbers are labels. I need to take a screenshot of the red area I drew. How can I perform this? I have Lazarus 1.0.14 and I didn't find any example about…
Alberto Rossi
  • 1,800
  • 4
  • 36
  • 58
1
vote
2 answers

Should *.lps files be included in version control or ignored?

Lazarus generates 3 file types for projects - *.lpr, *.lpi and *.lps. The first 2 files are necessary. Should I keep *.lps files in version control system or should I include *.lps files in global ignore list?
kludg
  • 27,213
  • 5
  • 67
  • 118
1
vote
1 answer

type identifier expected fpc compiler error

I have the following function which is supposed to split a string into a string array (I'm using Geany IDE and fpc compiler): function Split(const str: string; const separator: string): array of string; var i, n: integer; strline, strfield:…
Droidman
  • 11,485
  • 17
  • 93
  • 141
1
vote
1 answer

What was fpmake.pp used and is it still used?

I've used it once, not very well since I found hard to get by some decent examples/docs but it was a nice way of getting an environment done. Is it still a standard or as it been abandoned? Where could I find a beginner's how-to and also an…
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76