将C源代码转换成DLL会导致“未解析的外部". [英] Converting C source code to a DLL results in "unresolved externals"

查看:155
本文介绍了将C源代码转换成DLL会导致“未解析的外部".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行使用C编写的代码,该代码用于对话板dmv 960A 4T1pci.我正在尝试将该代码转换为DLL,但是我遇到了34个几乎相同的错误,这是它们的列表:

I am trying to run the code which is written using C and that is for a dialogic board dmv 960A 4T1pci. I am trying to convert that code to a DLL but I am facing 34 errors which are almost same , here is the list of them:

Linking...
   Creating library Debug/drivendll.lib and object Debug/drivendll.exp
drivendll.obj : error LNK2001: unresolved external symbol _sr_waitevt
drivendll.obj : error LNK2001: unresolved external symbol _gc_CCLibStatusEx
drivendll.obj : error LNK2001: unresolved external symbol _gc_Start
drivendll.obj : error LNK2001: unresolved external symbol _sr_setparm
drivendll.obj : error LNK2001: unresolved external symbol _gc_DropCall
drivendll.obj : error LNK2001: unresolved external symbol _gc_WaitCall
drivendll.obj : error LNK2001: unresolved external symbol _gc_ResetLineDev
drivendll.obj : error LNK2001: unresolved external symbol _gc_Close
drivendll.obj : error LNK2001: unresolved external symbol _gc_ResultInfo
drivendll.obj : error LNK2001: unresolved external symbol _gc_util_delete_parm_blk
drivendll.obj : error LNK2001: unresolved external symbol _gc_SetUserInfo
drivendll.obj : error LNK2001: unresolved external symbol _gc_util_insert_parm_val
drivendll.obj : error LNK2001: unresolved external symbol _gc_GetMetaEvent
drivendll.obj : error LNK2001: unresolved external symbol _gc_AlarmSourceObjectName
drivendll.obj : error LNK2001: unresolved external symbol _gc_AlarmSourceObjectID
drivendll.obj : error LNK2001: unresolved external symbol _gc_AlarmName
drivendll.obj : error LNK2001: unresolved external symbol _gc_AlarmNumber
drivendll.obj : error LNK2001: unresolved external symbol _gc_ReleaseCallEx
drivendll.obj : error LNK2001: unresolved external symbol _gc_AnswerCall
drivendll.obj : error LNK2001: unresolved external symbol _gc_AcceptCall
drivendll.obj : error LNK2001: unresolved external symbol _gc_GetCallInfo
drivendll.obj : error LNK2001: unresolved external symbol _gc_SetAlarmNotifyAll
drivendll.obj : error LNK2001: unresolved external symbol _gc_GetResourceH
drivendll.obj : error LNK2001: unresolved external symbol _gc_MakeCall
drivendll.obj : error LNK2001: unresolved external symbol _gc_OpenEx
drivendll.obj : error LNK2001: unresolved external symbol _gc_LoadDxParm
drivendll.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa@4
drivendll.obj : error LNK2001: unresolved external symbol __imp__gethostbyname@4
drivendll.obj : error LNK2001: unresolved external symbol __imp__gethostname@8
drivendll.obj : error LNK2001: unresolved external symbol _gc_util_insert_parm_ref
drivendll.obj : error LNK2001: unresolved external symbol _gc_SetCallingNum
drivendll.obj : error LNK2001: unresolved external symbol _gc_ErrorInfo
drivendll.obj : error LNK2001: unresolved external symbol _gc_Stop
Debug/drivendll.dll : fatal error LNK1120: 33 unresolved externals
Error executing link.exe.

推荐答案

更新

您似乎正在使用以下库:

It appears you are using the following library:

http://threebit.net/projects/jvr/download/

确保要链接到适合您平台的库对象,如另一个答案中所述.有一个Linux版本,一个Windows版本和一个Java开发者jar.确保在链接器设置中包含正确的链接.例如,这就是我们如何在Eclipse中做到这一点.

Ensure that you are linking to the appropriate library object for your platform, as mentioned here in another answer. There is a linux version, a windows version, and a jar for java dev. Ensure you have included the right one in your linker settings. For example, here is how we would do this in eclipse.

http://wiki.eclipse.org/CDT/用户/FAQ#How_do_I_add_an_external_library_to_my_C.2B.2B_project.3F

原始答案*

未解析的外部符号"将建议您在项目中需要使用和/或使用链接到某些库的类,而这些库未正确包含在您的项目中.无论您在生成文件中使用OR的哪种IDE,都应确保已正确包含项目所需的所有库文件.

"unresolved external symbol" would suggest that in your project you're requiring and or using classes linked to some library that you are not properly including in your project. Whatever IDE you're using OR in your makefiles, ensure that you have properly included any library files required for your project.

这篇关于将C源代码转换成DLL会导致“未解析的外部".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆