Difference between revisions of "Creating bindings for C libraries"

From Lazarus wiki
Jump to navigationJump to search
Line 3: Line 3:
 
This page describes how to create ''pascal bindings'' for ''C libraries''. Normally Pascal can not use C libraries directly. You have to create for every C function, type, variable a pascal translation. There is the ''h2pas'' tool, which can automatically translate many common C things. And there is a GUI for Lazarus using h2pas and other tools to automate the creation, so that if the bindings needs to be updated you don't have to restart all over.
 
This page describes how to create ''pascal bindings'' for ''C libraries''. Normally Pascal can not use C libraries directly. You have to create for every C function, type, variable a pascal translation. There is the ''h2pas'' tool, which can automatically translate many common C things. And there is a GUI for Lazarus using h2pas and other tools to automate the creation, so that if the bindings needs to be updated you don't have to restart all over.
  
=Tools=
+
=Install tools=
  
Install the h2paswizard package in the Lazarus IDE. Go to
+
The h2pas tool comes with every normal fpc installation.
 +
 
 +
Install the h2paswizard package in the Lazarus IDE. Go to "Components -> Configure installed packages ...". Select from the right list the H2PasWizard package and click 'Install selection', then 'Save and rebuild IDE'.
 +
Restart the IDE and you get a new menu entry: Tools -> h2pas
 +
 
 +
==

Revision as of 23:05, 20 September 2006

Overview

This page describes how to create pascal bindings for C libraries. Normally Pascal can not use C libraries directly. You have to create for every C function, type, variable a pascal translation. There is the h2pas tool, which can automatically translate many common C things. And there is a GUI for Lazarus using h2pas and other tools to automate the creation, so that if the bindings needs to be updated you don't have to restart all over.

Install tools

The h2pas tool comes with every normal fpc installation.

Install the h2paswizard package in the Lazarus IDE. Go to "Components -> Configure installed packages ...". Select from the right list the H2PasWizard package and click 'Install selection', then 'Save and rebuild IDE'. Restart the IDE and you get a new menu entry: Tools -> h2pas

==