Solved

Calling Pascal units

Posted on 1997-03-01
1
251 Views
Last Modified: 2010-04-15
Have code written in Pascal in a unit format. Would like to call the units from C. I would appreciate a simple example of how to do this. Thanks , JSS
0
Comment
Question by:jsulliva030197
1 Comment
 

Accepted Solution

by:
hooptie earned 50 total points
ID: 1249596
None of the C/C++ compilers that I have worked with can access .TPU's as is.  You'll need to recompile the units as .OBJ files and add them to your project window.  Once that is done, you'll need to declare each prototype (function) as an external function with the EXTERN definition.

Be careful though -- Pascal handles function names, pointers, and strings rather differently than C does.  I'd recommend that you be aware of these differences prior to calling the functions because it CAN BE a hair-pulling experience.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to get time_t value that is a week old 6 164
C++ vs C compilers 13 157
How to build c program using make in mingw environment? 9 54
smtp c source code 7 46
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now