Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to working with *.obj in delphi?

Posted on 2003-11-18
4
Medium Priority
?
3,833 Views
Last Modified: 2007-12-19
I am a sparetime coder,witch always program some strange tools,
I am pussy of using obj file in delphi.
I googled some articles says these obj file must be COFF format,
But I always can't pass the delphi's check.
I have translated some small c++ modouel to pascal,
now I must use minilzo with my delphi application,
but the minilzo.c has 2936 lines, so I think translate these lines to pascal is foo.
I googled a article gives a unit file to use minilzo.obj,
http://www.howtodothings.com/showarticle.asp?article=402
then I comple minilzo.c use bcc32:
bcc32 -c -WD -a4 -5 -eminilzo.obj minilzo.c

but when I add the lzo.pas into my unit1,The complier show me these messages:

[Error] Lzo.pas(13): Unsatisfied forward or external declaration: 'lzo1x_1_compress'
[Error] Lzo.pas(14): Unsatisfied forward or external declaration: 'lzo1x_decompress'
[Error] Lzo.pas(15): Unsatisfied forward or external declaration: 'lzo1x_decompress_safe'
[Error] Lzo.pas(16): Unsatisfied forward or external declaration: 'lzo_adler32'
[Error] Lzo.pas(17): Unsatisfied forward or external declaration: 'lzo_version'
[Error] Lzo.pas(18): Unsatisfied forward or external declaration: 'lzo_version_string'
[Error] Lzo.pas(19): Unsatisfied forward or external declaration: 'lzo_version_date'
[Fatal Error] MainUnt.pas(43): Could not compile used unit 'lzo.pas'

I change lots arguments of bcc32,but these message always crazy me.
The article's author's email account were closed,and the link he post in article were missed.

these source file avalible here:
http://dangban.nyist.net/pub/gamerip/TestLzo.zip

Could you can help me to resolve the faint problem?

Thx
0
Comment
Question by:azsd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 2

Accepted Solution

by:
alijunior earned 500 total points
ID: 9770553
Hi...

I downloaded your code and the necessaries changes are as follows:

{$LINK 'minilzo.obj'}

function _lzo1x_1_compress...
function _lzo1x_decompress...
function _lzo1x_decompress_safe...
function _lzo_adler32...
function _lzo_version...
function _lzo_version_string...
function _lzo_version_date...


Type an underscore ("_") character before each name of external procedure in declaration. This is because, for historic reasons, most C compilers still generate C functions with names that start with an underscore. To import them, you'll have to use the "underscored" names. You could tell the C++Builder compiler to omit the underscores, but I normally don't do that. The underscores clearly show that we are using C functions.

If you found some bugs running these procedures, try change the 'stdcall' to 'cdecl' at the end of each declaration.

I wait to have been able to solve its doubt.

0
 

Author Comment

by:azsd
ID: 9770853
Yeah I passed the compiling~~
It's time to go bed in my timezone(China GMT+8) ,I will test whether these passed function's work correct.

Thx,I think I made a native mistake.
0
 

Author Comment

by:azsd
ID: 9770854
Yeah I passed the compiling~~
It's time to go bed in my timezone(China GMT+8) ,I will test whether these passed function's work correct.

Thx,Alijunior
I think I made a native mistake.
0
 

Author Comment

by:azsd
ID: 9771080
after go to sleep,
I test the _lzo_version function,
It works fine.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

715 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