Catalog · How the catalog works
libFPC
libFPC - FreePascal in your pocket!
- ★ 1 on GitHub
Anyone may press Interesting, signed in or not. It helps others find this project.
README
libFPC
FreePascal in your pocket!
libFPC is a Delphi library that embeds the FreePascal Compiler (FPC), enabling your applications to compile Pascal source code at runtime. With libFPC, you can dynamically generate EXEs, DLLs, or other binary outputs without invoking external toolchains or requiring any manual steps from users.
Whether you're building a plugin architecture, scripting engine, code playground, or runtime compiler toolchain—libFPC puts FreePascal’s power directly into your application.
✨ Features
- 🛠️ Runtime compilation of Pascal source code using FPC
- ⚙️ Generate EXEs, DLLs, or custom binaries from within your Delphi app
- 🚀 True native compilation with full control over the build process
- 🔧 Supports build modes, version info, output paths, icons, and more via inline project directives
- 🧩 Ideal for scripting, plugin frameworks, live coding environments, and automation tools
🚧 Project Status
This repository is under active development.
The core functionality is stable and usable. Additional features, examples, and documentation are in progress and will be released incrementally. Feedback, issues, and contributions are welcome!
📦 Installation
Getting started with libFPC is quick and easy:
- Download
libFPCfrom the github. You can also fork the repo if you wish to make contributions. - Add
libFPCto yourusesclause. - Start Coding! libFPC brings the power of the FreePascal compiler into the hands of your application.
🚀 Basic Usage
Here’s how to compile a Pascal source file (test1.pas) into an executable from your Delphi code:
procedure Test1();
var
LlibFPC: TLibFPC;
begin
// Create an instance of TLibFPC
LlibFPC := TLibFPC.Create();
try
// Assign the Pascal source file to compile
LlibFPC.SetProjectFilename('test1.pas');
// Compile the file and display the result
if LlibFPC.Compile() then
WriteLn('Success!')
else
WriteLn('Failed!');
finally
LlibFPC.Free();
end;
end;🧾 Project Directives
libFPC supports special inline directives in the main Pascal source file to control project settings, compilation behavior, and output metadata. These must appear at the top of the file, in the format shown below:
{==================== [PROJECT DIRECTIVES] =================================}
{@APPTYPE CONSOLE} // CONSOLE|GUI
{@OUTPUTPATH ".\"}
{.@EXEICON ".\main.ico"} // remove "." before @, set path to icon
{@SEARCHPATH ".\"} // path1;path2;path3 seperated by ";"
{@BUILDCONFIG DEBUG} // DEBUG|RELEASE
{@ADDVERSIONINFO NO} // YES|NO
{@MAJORVER 1} // valid numerical value 0-n
{@MINORVER 0} // valid numerical value 0-n
{@PATCHVER 0} // valid numerical value 0-n
{@PRODUCTNAME "Project Name"}
{@DESCRIPTION "Your Project"}
{@COMPANYNAME "Your Company"}
{@COPYRIGHT "Copyright © 2025-present Your Company™"}
{@TRADEMARK "All Rights Reserved."}
{@COMMENT "http://yourcompany.com"}
{===========================================================================}
program test1;
uses
sysutils;
var
i: integer;
begin
for i := 1 to 20 do
writeln(i);
end.These directives allow you to define everything from application type and versioning to icon resources and search paths—ensuring clean and controlled builds right from your source code.
💬 Support & Resources
- 🐞 Report Issues: GitHub Issue Tracker
- 💬 Join the Community: Forum | Discord
- 📚 Learn Delphi: Learn Delphi
🤝 Contributing
We welcome contributions to libFPC! 🚀
💡 Ways to Contribute:
- 🐛 Report Bugs – Help improve
libFPCby submitting issues. - ✨ Suggest Features – Share ideas to enhance its functionality.
- 🔧 Submit Pull Requests – Improve the codebase and add features.
🏆 Contributors
https://github.com/tinyBigGAMES/libFPC/graphs/contributors
📜 License
libFPC is distributed under the BSD-3-Clause License, allowing redistribution and modification in both source and binary forms. See the LICENSE for details.
💖 Support & Sponsorship
Your support keeps libFPC evolving! If you find this library useful, please consider sponsoring the project. Every contribution helps drive future enhancements and innovations.
Other ways to support:
- ⭐ Star the repo – Show your appreciation.
- 📢 Share with your network – Spread the word.
- 🐛 Report bugs – Help improve
libFPC. - 🔧 Submit fixes – Contribute by fixing issues.
- 💡 Suggest features – Help shape its future.
🚀 Every contribution makes a difference – thank you for being part of the journey!
🔥 libFPC – FreePascal in your pocket!



