Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


ID: 29310, January 28, 2013 - Building a C++ 64-bit UDF for InterBase

by David Intersimone Email: Anonymous


In this twenty-eight video you'll learn how to build, install and use an InterBase 64-bit UDF (user defined function) built with the C++Builder 64-bit compiler for Windows.
Download Details
FTP  download also available
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For C++Builder, Version 1.0  to 17.0 75 downloads
Copyright: All rights reserved


Size: 14,752,008 bytes
Updated on Sun, 03 Feb 2013 22:13:37 GMT
Originally uploaded on Sun, 03 Feb 2013 22:13:14 GMT
SHA1 Hash: 5F08BFD64F2FD565C9B02DAEBC6EF04DF62C3A69
MD5 Hash: A2CD9A49698A5AC2AD5250BE4B2E95D5

    Explore the files in this upload

Description
During each day of January 2013, I am creating a new video showing you how to use the new C++Builder XE3 compilers for Win32, Win64 and OSX to create multi-platform, database, multi-tier, HD and 3D applications. In this twenty-eight video you'll learn how to build, install and use an InterBase 64-bit UDF (user defined function) built with the C++Builder 64-bit compiler for Windows. Stay tuned to my blog for additional C++ programming videos each day.

Building the DLL:
1. Create a new Dll Project. File|New|Dynamic Link Library
2. Add a target for Win 64
3. Add a target for Mac OSX. To build for Mac you will need a remote Mac profile setup.
4. Add these 3 files for using ib_util_malloc, as InterBase UDFs using Delphi and C++Builder need to allocate and free memory using the same memory allocation convention.
ib_util.lib for Win32
ib_util64.a for Win64
ib_util.dylib for Mac OSX
5. Add these 2 paths for the compiler include path
C:\ProgramData\Embarcadero\InterBase\rad_xe3\examples is the path for example.h
C:\Program Files (x86)\Embarcadero\RAD Studio\10.0\InterBaseXE3\SDK\include is the path for ib_util.h
6. Because the dll is C++ but the example code is C the code for the .cpp file and the included ib_util.h need to be defined as extern C
7. If the Compiler can't find some header files these are the default locations
C:\ProgramData\Embarcadero\InterBase\rad_xe3\examples is the path for example.h
C:\Program Files (x86)\Embarcadero\RAD Studio\10.0\InterBaseXE3\SDK\include for ib_util.h
Deploying the dll
To Deploy on win32 and Win64 copy IBUDF.dll to the InterBase\UDF directory.
To Deploy on Mac OSX, the file libcgunwind.1.0.dylib must be copied to /usr/lib along with IBUDF.dylib being copied to the InterBase/UDF Directory
Adding the UDF in InterBase - In either isql or with IBConsole execute the following SQL
DECLARE EXTERNAL FUNCTION LOWER
VARCHAR(256) CHARACTER SET NONE
RETURNS CSTRING(80) CHARACTER SET NONE FREE_IT
ENTRY_POINT 'fn_lower_c' MODULE_NAME 'IBUDF';
Using the UDF - In either isql or with IBConsole execute the following SQL
select lower(FIRST_NAME) from employee
January 28, 2013 - Building, installing and using a C++Builder 64-bit InterBase UDF (user defined function)

Filename: 2013-01-28-CppInterBaseUDF64.mp4

Watch on YouTube: http://www.youtube.com/watch?v=asVIl1ttLUk

Duration: 5 minutes and 16 seconds

Size: 15.6mb

Format: MP4

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Server Response from: ETNACDC03