如何链接msvcrt.lib?

时间:2014-02-18 12:16:06

标签: delphi delphi-xe5

如何将msvcrt.lib与delphi链接?我正在尝试将.obj文件与Delphi链接。并且它有效,但它有太多缺少依赖性。

[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__purecall'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '??2@YAPAXI@Z'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '??3@YAXPAX@Z'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '_atexit'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__imp___hypot'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__imp__memchr'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__imp__memmove'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__imp_?_Debug_message@std@@YAXPB_W0I@Z'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__imp_?_Orphan_all@_Container_base12@std@@QAEXXZ'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__imp_?_Xbad_alloc@std@@YAXXZ'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__imp_?_Xlength_error@std@@YAXPBD@Z'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__imp_?_Xout_of_range@std@@YAXPBD@Z'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '??_Eerror_category@std@@UAEPAXI@Z'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__imp_?_Syserror_map@std@@YAPBDH@Z'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__imp_?_Winerror_map@std@@YAPBDH@Z'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '??_E_Generic_error_category@std@@UAEPAXI@Z'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '??_E_Iostream_error_category@std@@UAEPAXI@Z'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '??_E_System_error_category@std@@UAEPAXI@Z'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '@__security_check_cookie@4'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__CxxThrowException@8'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '___CxxFrameHandler3'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '??_7type_info@@6B@'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '___security_cookie'
[dcc32 Error] Project1.dpr(24): E2065 Unsatisfied forward or external declaration: '__fltused'

1 个答案:

答案 0 :(得分:2)

您无法将.lib文件链接到Delphi。如果链接.obj文件,则必须通过以下任一方式提供任何缺少的功能:

  1. 链接定义该功能的.obj文件,或
  2. 在Delphi中实现该功能,并使其对链接其他.obj文件的单元可见。
  3. 更大的问题是,您正在尝试链接C ++对象以及我不了解的最佳知识。如果这真的是你需要做的,那么你必须将它编译成DLL并以这种方式链接它。