# Using OpenCV with Embarcadero Delphi 10.3.3 (Object Pascal)

**URL:** <https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485>\
**Category:** Uncategorized\
**Tags:** delphi, pascal\
**Created:** [March 30, 2021, 11:06am UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485 "2021-03-30T11:06:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![rob-1982](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rob-1982](https://forum.opencv.org/u/rob-1982)\
**Post date:** [March 30, 2021, 11:06am UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/1 "2021-03-30T11:06:51Z")

</div>

Hello to all forum members,

I’m new to the forum and also a newbie to OpenCV. As a development system I almost exclusively use Embarcadero Delphi 10.3.3 (sometimes C++ Builder). So far I have already successfully integrated several external C libraries into Delphi. As I heard, OpenCV is now developed in C ++. Unfortunately I 'm not aware of any possibility to use C ++ classes in Delphi. On Github there is a Delphi wrapper for OpenCV, but unfortunately only for **version 2**. _Does anyone know a possibility to use current versions of openCV with Delphi or are there_ _efforts on the part of the developers of openCV to publish C interfaces again?_

Thx in advance.

Greetings  
Rob

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 30, 2021, 2:54pm UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/2 "2021-03-30T14:54:09Z")

</div>

C interfaces will not come back. they were removed deliberately.

if you need something with a C interface, look into OpenVX.

or consider writing a wrapper. the python bindings are a wrapper (automatically generated… but from custom code) that primarily translates between cv::Mat and numpy matrices. it’s basically C++ code that uses OpenCV and presents C functions that extend python. I’m sure you could do something similar.

I can’t believe that Delphi wouldn’t have gained some way of interfacing with C++ libraries… what is this?

> **[Mixing Delphi and C++](https://blogs.embarcadero.com/mixing-delphi-and-c/)**

> **[Implementing C++ libraries in Delphi for HPC \[Tutorial\] | Packt Hub](https://hub.packtpub.com/implementing-c-libraries-in-delphi-for-hpc-tutorial/)**
>
> This tutorial will provide solution to C++ users to implement solutions using pre-packaged C++ libraries for high-performance operations in Delphi.

this looks like you’ll have to use C++ Builder to build OpenCV, because you’d need C++ Builder for this type of compatibility.

---

<div class="post-metadata">

**Author:** ![rob-1982](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rob-1982](https://forum.opencv.org/u/rob-1982)\
**Post date:** [March 30, 2021, 3:38pm UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/3 "2021-03-30T15:38:20Z")

</div>

thx for your fast reply  
the Embarcadero blog “Mixing Delphi and C++” refers to the fact that it is possible  
to include C ++ Builder source code files in delphi projects but no compiled .obj files

the Packt article (i have the whole book btw) describes the creation of a wrapper

I’ve already tried to compile the openCV sources in c ++ builder many times, unfortunately without success

thx again for your answer

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 30, 2021, 5:34pm UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/4 "2021-03-30T17:34:45Z")

</div>

I suspect that the C# folks face similar problems although they can probably just use the MSVC-built binaries. I haven’t seen a C# “wrapper” that is a straight exposition of OpenCV’s C++. they all come up with their own classes. perhaps that’s due to them being born in the C era of OpenCV and generally little progress/support.

apparently cmake can now [target C++ Builder](http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_CMake_with_C%2B%2B_Builder) so that should make things easier.

some of the arguments (“intel-donated libraries”) in [this thread](https://community.embarcadero.com/component/easydiscuss/how-to-use-opencv-in-c-builder-xe10?Itemid=1) also apply to GCC/MinGW, but OpenCV builds fine with those

in the same thread I do see someone claim that he got OpenCV v3.x working with some patches so that’s a start

---

<div class="post-metadata">

**Author:** ![rob-1982](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rob-1982](https://forum.opencv.org/u/rob-1982)\
**Post date:** [April 8, 2021, 12:43pm UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/5 "2021-04-08T12:43:06Z")

</div>

I generated the builds in CMake a few times with “Ninja” settings and so far it works quite well.  
But when I then run ninja after a short time I get error messages during compilation.

Here’s the console text:

[1/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jfdctint.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jfdctint.c:  
[2/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jfdctfst.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jfdctfst.c:  
[3/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jidctflt.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jidctflt.c:  
[4/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jquant1.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jquant1.c:  
[5/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jidctfst.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jidctfst.c:  
[6/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jidctred.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jidctred.c:  
[7/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jutils.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jutils.c:  
[8/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jmemnobs.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jmemnobs.c:  
[9/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jquant2.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jquant2.c:  
[10/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jmemmgr.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jmemmgr.c:  
[11/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jcarith.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jcarith.c:  
[12/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jidctint.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jidctint.c:  
[13/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jaricom.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jaricom.c:  
[14/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jdarith.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jdarith.c:  
[15/1557] Building C object 3rdparty\libjpeg-turbo\CMakeFiles\libjpeg-turbo.dir\src\jsimd\_none.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src\jsimd\_none.c:  
[16/1557] Building C object 3rdparty\libtiff\CMakeFiles\libtiff.dir\tif\_codec.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff\tif\_codec.c:  
[17/1557] Building C object 3rdparty\libtiff\CMakeFiles\libtiff.dir\tif\_aux.c.obj  
FAILED: 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif\_aux.c.obj  
C:\PROGRA~2\EMBARC~1\Studio\20.0\bin\bcc64.exe -D\_WIN32\_WINNT=0x0601 -I3rdparty\zlib -IC:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\zlib -I3rdparty\libtiff -IC:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff -I3rdparty\libjpeg-turbo -IC:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src -isystem “C:\Program Files (x86)\Embarcadero\Studio\20.0\include\windows\crtl” -isystem “C:\Program Files (x86)\Embarcadero\Studio\20.0\include\windows\sdk” -isystem “C:\Program Files (x86)\Embarcadero\Studio\20.0\include\windows\rtl” -isystem “C:\Program Files (x86)\Embarcadero\Studio\20.0\include\dinkumware64” -isystem . -tM -fsigned-char -O0 -g -o3rdparty\libtiff\CMakeFiles\libtiff.dir\tif\_aux.c.obj -c C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff\tif\_aux.c  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff\tif\_aux.c:  
In file included from C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff\tif\_aux.c:32:  
In file included from C:\Program Files (x86)\Embarcadero\Studio\20.0\include\windows\crtl\math.h:723:  
In file included from C:\Program Files (x86)\Embarcadero\Studio\20.0\include\dinkumware64\ymath.h:4:  
In file included from C:\Program Files (x86)\Embarcadero\Studio\20.0\include\dinkumware64\yvals.h:10:  
C:\Program Files (x86)\Embarcadero\Studio\20.0\include\dinkumware64\xkeycheck.h:44:5: error: keyword defined before including C standard header  
#error keyword defined before including C standard header  
^  
1 error generated.  
[18/1557] Building C object 3rdparty\libtiff\CMakeFiles\libtiff.dir\tif\_dirinfo.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff\tif\_dirinfo.c:  
[19/1557] Building C object 3rdparty\libtiff\CMakeFiles\libtiff.dir\tif\_color.c.obj  
FAILED: 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif\_color.c.obj  
C:\PROGRA~2\EMBARC~1\Studio\20.0\bin\bcc64.exe -D\_WIN32\_WINNT=0x0601 -I3rdparty\zlib -IC:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\zlib -I3rdparty\libtiff -IC:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff -I3rdparty\libjpeg-turbo -IC:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libjpeg-turbo\src -isystem “C:\Program Files (x86)\Embarcadero\Studio\20.0\include\windows\crtl” -isystem “C:\Program Files (x86)\Embarcadero\Studio\20.0\include\windows\sdk” -isystem “C:\Program Files (x86)\Embarcadero\Studio\20.0\include\windows\rtl” -isystem “C:\Program Files (x86)\Embarcadero\Studio\20.0\include\dinkumware64” -isystem . -tM -fsigned-char -O0 -g -o3rdparty\libtiff\CMakeFiles\libtiff.dir\tif\_color.c.obj -c C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff\tif\_color.c  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff\tif\_color.c:  
In file included from C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff\tif\_color.c:38:  
In file included from C:\Program Files (x86)\Embarcadero\Studio\20.0\include\windows\crtl\math.h:723:  
In file included from C:\Program Files (x86)\Embarcadero\Studio\20.0\include\dinkumware64\ymath.h:4:  
In file included from C:\Program Files (x86)\Embarcadero\Studio\20.0\include\dinkumware64\yvals.h:10:  
C:\Program Files (x86)\Embarcadero\Studio\20.0\include\dinkumware64\xkeycheck.h:44:5: error: keyword defined before including C standard header  
#error keyword defined before including C standard header  
^  
1 error generated.  
[20/1557] Building C object 3rdparty\libtiff\CMakeFiles\libtiff.dir\tif\_compress.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff\tif\_compress.c:  
[21/1557] Building C object 3rdparty\libtiff\CMakeFiles\libtiff.dir\tif\_close.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff\tif\_close.c:  
[22/1557] Building C object 3rdparty\libtiff\CMakeFiles\libtiff.dir\tif\_dir.c.obj  
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.  
C:\DelphiComps\openCV\4.5.2\_B\source\3rdparty\libtiff\tif\_dir.c:  
ninja: build stopped: subcommand failed.

---

<div class="post-metadata">

**Author:** ![Geont](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/geont/32/958_2.png) [@Geont](https://forum.opencv.org/u/Geont)\
**Post date:** [June 8, 2021, 11:12am UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/6 "2021-06-08T11:12:54Z")

</div>

Did you find a solution? I am now trying to build it but I am ending at exact same point.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [June 8, 2021, 11:31am UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/7 "2021-06-08T11:31:03Z")

</div>

@Geont, sad as it is, noone has succeeded, ever.

try to use a better supported compiler, and don’t insist on using opencv from pascal  
(there is absolutely NO support for that)

---

<div class="post-metadata">

**Author:** ![rob-1982](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rob-1982](https://forum.opencv.org/u/rob-1982)\
**Post date:** [October 26, 2021, 1:53pm UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/8 "2021-10-26T13:53:02Z")

</div>

that you can’t access C ++ classes with Delphi is clear, it’s the same the other way round, it doesn’t work if you don’t provide access to Delphi classes in a C wrapper. With a C ++ compiler according to the ISO standard it should look different, or what else does this standard exist for?

---

<div class="post-metadata">

**Author:** ![rob-1982](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rob-1982](https://forum.opencv.org/u/rob-1982)\
**Post date:** [March 31, 2022, 12:46pm UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/9 "2022-03-31T12:46:34Z")

</div>

it’s not true, that there is absolutely no support for Pascal

> **[GitHub - Laex/Delphi-OpenCV-Class: Experimental Delphi binding for OpenCV 4.XX](https://github.com/Laex/Delphi-OpenCV-Class)**
>
> Experimental Delphi binding for OpenCV 4.XX. Contribute to Laex/Delphi-OpenCV-Class development by creating an account on GitHub.

this is the NEW openCV for Pascal (Classes)

You should expect more from a moderator, especially if you say something so full-bodied that is not true

I seem to be in the wrong forum here if the only answer I get is “don’t insist on using opencv from pascal”  
But that may be due to the ignorance of some of those involved  
Have a nice day

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 31, 2022, 1:18pm UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/10 "2022-03-31T13:18:56Z")

</div>

- first commit: November 21, 2021
- 54 commits
- 6 forks, 18 stars

looks new and not too widely known/used

can’t fault someone for not knowing the future, from a June 2021 viewpoint

I would be happy for all the Delphi/Pascal users if that project delivers what it promises.

_edit:_ oh nice, that person has been working on v2.x bindings too. I guess they would know what they’re doing then.

> **[GitHub - Laex/Delphi-OpenCV: Project Delphi-OpenCV. Translation of OpenCV...](https://github.com/Laex/Delphi-OpenCV)**
>
> Project Delphi-OpenCV. Translation of OpenCV library header files in Delphi - GitHub - Laex/Delphi-OpenCV: Project Delphi-OpenCV. Translation of OpenCV library header files in Delphi

---

<div class="post-metadata">

**Author:** ![rob-1982](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rob-1982](https://forum.opencv.org/u/rob-1982)\
**Post date:** [November 25, 2024, 5:12pm UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/11 "2024-11-25T17:12:50Z")

</div>

For everyone who’s interested C++Builder v12.2 is now able to build openCV and here is a link form David Millington from Embarcadero on how to do it:

> **[Introducing Amazing CMake Support in C++Builder 12.2](https://blogs.embarcadero.com/introducing-amazing-cmake-support-in-cbuilder-12-2/)**
>
> C++Builder and RAD Studio 12.2 bring a fantastic feature for C++: full CMake support for the new Win64 Modern toolchain. It’s available in GetIt now, and it comes with some amazing demos. You can build VCL apps, FMX apps, packages, DLLs, console...

---

<div class="post-metadata">

**Author:** ![laentir](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/laentir/32/11383_2.png) [@laentir](https://forum.opencv.org/u/laentir)\
**Post date:** [June 12, 2026, 12:37pm UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/12 "2026-06-12T12:37:06Z")

</div>

> **[GitHub - Laex/Delphi-OpenCV5](https://github.com/Laex/Delphi-OpenCV5)**
>
> Contribute to Laex/Delphi-OpenCV5 development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Myar\_joyia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/myar_joyia/32/14430_2.png) [@Myar\_joyia](https://forum.opencv.org/u/Myar_joyia)\
**Post date:** [August 22, 2026, 5:37pm UTC](https://forum.opencv.org/t/using-opencv-with-embarcadero-delphi-10-3-3-object-pascal/2485/13 "2026-08-22T17:37:05Z")

</div>

It’s interesting to see how this project has evolved over the years. The progress toward newer OpenCV bindings and the improved CMake support in recent C++Builder versions make the Delphi/Pascal ecosystem look much more promising for OpenCV development. It’s great to see these efforts continuing and becoming more accessible for developers who want to use OpenCV outside the usual C++ environment.
