faqts : Computers : Programming : Languages : Delphi

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

23 of 36 people (64%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

Delphi: C++: How to possibly convert C++ .lib files (e.g. via .dll) to be used in Borland Delphi?

Aug 10th, 2003 10:17
Knud van Eeden,


-----------------------------------------------------------------------
--- Knud van Eeden - Sunday 10 August 2003 - 06:24 pm -----------------

Language: Computer: Borland: Delphi: C++: Code: Convert: How to
possibly convert (Microsoft Visual C++) C++ .lib files (e.g. via .dll)
to be used in Borland Delphi?

The following is intended to give just some ideas about how to proceed.

Use e.g. the general problem solving method of using a very simple
example, and then gradually refining and expanding it after more
experience.

E.g.

In C++ create the simplest possible example of a .lib file.

Then try to convert it using the shown approaches here from C++ to
Delphi.

---

Method: Direct approach: .lib

"How do I link an object file that is a library of functions created 
in C?"

Download the file "LC2P01.FAQ.  The C run-time library (=RTL) is needed
by the object file. Since Pascal can not link the C RTL as is, you will
need the RTL source and will need to modify it so that it can be linked
by TP.

[ Internet: see also: http://groups.google.com/groups?
q=LC2P01.FAQ&hl=en&lr=&ie=UTF-8&selm=5aE0HOUqvSB%
40dfg.ldb.han.de&rnum=2 ]

[ Internet: see also: http://www.google.com: search for 'use C++ .dll
in Delphi': http://home.t-online.de/home/rvelthuis/articles/articles-
cobjs.htm ]

---

Method: Indirect approach:  .lib to .dll to .dll

---

You could try this indirect approach:

 1. -Convert VC++ .lib to VC++ .dll

 2. -Convert VC++ .dll to BC++ .dll

 3. -Convert BC++ .dll to BD .dll

---

Steps: Overview:

 1. Convert the Visual C++ .lib to a Visual C++ .dll using Microsoft
Visual C++

      http://groups.google.com/groups?q=Create+static+lib+library+in+C%
2B%2B&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3B4F27B0.9CD39D1%40vista-
soft.com&rnum=6

 2. Convert the Visual C++ .dll to a Borland C++ .dll

      http://groups.google.com/groups?q=Create+static+lib+library+in+C%
2B%2B&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3B4F27B0.9CD39D1%40vista-
soft.com&rnum=6

 3. -Convert Borland C++ .dll to Borland Delphi .dll

      [ Internet: source: http://www.google.com: search for 'use
C++ .dll in Delphi': http://groups.google.com/groups?hl=en&lr=&ie=UTF-
8&oe=UTF-8&threadm=8f0m7i%242hec%241%
40news.adamastor.ac.za&rnum=2&prev=/groups%3Fq%3Duse%2BC%252B%252B%
2B.dll%2Bin%2BDelphi%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%
26selm%3D8f0m7i%25242hec%25241%2540news.adamastor.ac.za%26rnum%3D2 ]

      [ Internet: see also: http://home.t-
online.de/home/rvelthuis/articles/articles-cppobjs.htm ]

---

See also:

[ Internet: source: http://www.google.com: search for 'convert lib to 
dll': http://groups.google.com/groups?
q=convert+lib+to+dll&hl=en&lr=&ie=UTF-8&oe=UTF-
8&selm=903257912.3738.0.nnrp-06.d4e47786%40news.demon.co.uk&rnum=5 ]

[ Internet: source: http://www.google.com: search for 'convert lib to 
dll': http://groups.google.com/groups?
q=convert+lib+to+dll&hl=en&lr=&ie=UTF-8&oe=UTF-
8&selm=9340ascvsugq2uj3u8gatcu1abdc561pd5%404ax.com&rnum=3 ]

[ Internet: source: http://www.google.com: search for 'convert lib to 
dll': http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-
8&threadm=337C9765.685C%40raleigh.ibm.com&rnum=4&prev=/groups%3Fq%
3Dconvert%2Blib%2Bto%2Bdll%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%
26selm%3D337C9765.685C%2540raleigh.ibm.com%26rnum%3D4 ]

[ Internet: source: http://www.google.com: search for 'convert lib to 
dll': http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-
8&threadm=384EB52F.C5367725%40imsysinc.com&rnum=7&prev=/groups%3Fq%
3Dconvert%2Blib%2Bto%2Bdll%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%
26selm%3D384EB52F.C5367725%2540imsysinc.com%26rnum%3D7 ]

[ Internet: source: http://www.google.com: search for 'lib Delphi C++ 
dll': http://www.experts-
exchange.com/Programming/Programming_Languages/Delphi/Q_20343263.html ]

---

See also:

"DLL to Lib can convert a DLL file into equivalent static library 
without requiring its source codes"

http://www.binary-soft.com/dll2lib/dll2lib.htm

http://www.binary-soft.com/faq.htm

-----------------------------------------------------------------------