Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > Kylix

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 08-06-2004, 01:37 PM
Fortuna Fortuna is offline
Junior Member
 
Join Date: Aug 2004
Posts: 3
Default How write DLL in Kylix C++ and main program in Kylix for Delphi.

How write DLL in Kylix C++ and
main program in Kylix for Delphi.


//----DLL C ++ --------------------------------------------

//---------------------------------------------------------------------------
// Important note regarding exception handling across multiple
// binary modules (executables and shared objects):
//
// For exception handling to work across multiple binary
// modules, all binary modules need to use the same copy
// of the shared exception handling code.
//
// To accomplish this, the following must be done:
//
// 1) All binary modules which use the Delphi RTL (CLX)
// must be built with the same version of the rtl runtime
// package.
//
// 2) All binary modules must dynamically link to the
// exception handling shared object libborunwind.so. This
// is accomplished by enabling the "Use dynamic RTL/STL"
// linker option.
//
// If this is not done, exceptions raised in one module may
// cause unintended side effects in other modules.
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------
int sum(int x)
{
return(x+x);
}







unit Unitaaa; // Main program
interface
uses
SysUtils, Types, Classes, Variants, QTypes, QGraphics, QControls, QForms,
QDialogs, QStdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
function sum(a: integer): integer; stdcall; external 'liba.so';
procedure TForm1.Button1Click(Sender: TObject);
var
a:Integer;

begin;
a:=3;
Label1.caption:= IntToStr(sum(a));
end;
end.

When l start the main program then show

this
/root/a/Projectaaa: relocation error: /root/a/Projectaaa: undefined symbol: sum

Where is the problem.
Nice day from Slovenija.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:54 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.