开发者

Linking C .obj files into Delphi application, resolving standard C dependencies

开发者 https://www.devze.com 2022-12-14 18:36 出处:网络
I compiled libxml2 with BCC 5.5 command line compiler, now I have lots of .obj files which I\'d like to link into my Delphi application. Unfortunately, I get lots of \"Unsatisfied forward or external

I compiled libxml2 with BCC 5.5 command line compiler, now I have lots of .obj files which I'd like to link into my Delphi application. Unfortunately, I get lots of "Unsatisfied forward or external declaration" errors, pointing to standard C library f开发者_JAVA百科unctions like memcpy, open, recv etc ... What should I do to compile it correctly? I'd like to avoid depending on msvcrt.dll or any other external libraries.

Thanks in advance!


Depending on the version of Delphi you have, there should be a unit called crtl.dcu with which you can link. Just use the $L directive for each .obj file in a unit that also uses crtl. You may also need to "use" other various units like Windows, WinSock, etc... The point is to provide the symbols and functions to resolve during the link phase.

This is the same technique used to statically link in the DataSnap TClientDataSet code used to also build midas.dll.


you should read article of Rudy here "Using C object files in Delphi"


Don't use those functions, but rewrite them to call operating system functions (kernel32/system32) directly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号