错误LNK2019未解析的外部符号 [英] error LNK2019 unresolved external symbol

查看:200
本文介绍了错误LNK2019未解析的外部符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对C ++很新,所以我下载了一个示例C ++程序。示例程序似乎在编译时遇到以下错误: -

 错误22错误LNK2019:未解析的外部符号_acsEnumServerNames @ 12引用函数protected:virtual int __thiscall COpenTsrv :: OnInitDialog(void)(?OnInitDialog @ COpenTsrv @@ MAEHXZ)Opentsrv.obj 

我跟踪它到引用的函数,但我不知道有什么错误吗?

  BOOL COpenTsrv :: OnInitDialog()
{
CDialog :: OnInitDialog();

CenterWindow();


acsEnumServerNames(ST_CSTA,AddToList,(unsigned long)(CComboBox *)& m_TserverListControl);

UpdateData(FALSE);

以下是构建日志。显然还有其他错误,但想从第一个开始。

  1>生成代码... 
1>编译资源...
1>将资源清单编译为资源...
1>链接...
1> Opentsrv.obj:error LNK2019:未解析的外部符号_acsEnumServerNames @ 12引用函数protected:virtual int __thiscall COpenTsrv :: OnInitDialog(void)(?OnInitDialog @ COpenTsrv @@ MAEHXZ)
1> Opentsrv.obj:error LNK2019:未解析的外部符号_acsQueryAuthInfo @ 8在函数protected :void __thiscall COpenTsrv :: OnSelchangeTserverlist(void)(?OnSelchangeTserverlist @ COpenTsrv @@ IAEXXZ)
1> Opentsrv.obj:error LNK2019:未解析的外部符号_acsAbortStream @ 8在函数protected:virtual void __thiscall中引用CopenTsrv: :OnOK(void)(?OnOK @ COpenTsrv @@ MAEXXZ)
1> Tsapi.obj:error LNK2001:未解析的外部符号_acsAbortStream @ 8
1> Opentsrv.obj:error LNK2019: _acsEventNotify @ 16引用函数protected:virtual void __thiscall COpenTsrv :: OnOK(void)(?OnOK @ COpenTsrv @@ MAEXXZ)
1> Opentsrv.obj:error LNK2019:unresolved external symbol _acsOpenStream @ 60函数protected:virtual void __thiscall COpenTsrv :: OnOK(void)(?OnOK @ COpenTsrv @@ MAEXXZ)
1> Opentsrv.obj:error LNK2019:未解析的外部符号_cstaMonitorDevice @ __thiscall COpenTsrv :: OnTsapiAcsConfirmation(unsigned int,long)(?OnTsapiAcsConfirmation @ COpenTsrv @@ IAEJIJ @ Z)
1> Sampldlg.obj:error LNK2019:未解析的外部符号_cstaMakeCall @ 20在函数protected:void __thiscall CSampleDlg :: OnHangup(void)@Explorer(void)(@Execute);在下面的函数中引用的函数protected:void __thiscall中引用的未解析的外部符号_cstaClearConnection @ )(?OnHangup @ CSampleDlg @@ IAEXXZ)
1> Sampldlg.obj:error LNK2019:未解析的外部符号_cstaAnswerCall @ 16在函数protected:void __thiscall CSampleDlg :: OnAnswer(void) CSampleDlg @@ IAEXXZ)
1> Tsapi.obj:error LNK2019:未解析的外部符号_acsGetEventPoll @ 20在函数protected:long __thiscall中引用CTsapiWnd :: OnTsapiMsg(unsigned int,long)(?OnTsapiMsg @ CTsapiWnd @@ IAEJIJ @ Z)
1> C:\Users \steventang\Documents\Visual Studio 2005 \Projects\TSAPINEW\Debug\TSAPINEW.exe:致命错误LNK1120:10未解析的外部
1>构建日志已保存在file:// c:\Users\steventang\Documents\Visual Studio 2005\Projects\TSAPINEW\TSAPINEW\Debug\BuildLog.htm
1> TSAPINEW - 12错误,21警告
==========重建全部:0成功,1失败,0跳过======== ==

任何帮助指向正确的方向将非常感激。



感谢

解决方案

看起来像是您的编辑太成功了。只有链接无效。



可能是链接器抱怨,因为你定义了方法acsEnumServerNames的头,但是你没有提供方法的实现。 / p>

也许你使用了头文件,但是你没有提供头文件所属的库。



输出到acsEnumServerNames所属的pakage,并检查您是否在某些.c / .cpp文件中实现了该方法,或者如果实现应该由您所依赖的某个库提供。


I am quite new to C++ so I downloaded a sample C++ program. The sample program seems to hit the following error when it is compiling :-

Error   22  error LNK2019: unresolved external symbol _acsEnumServerNames@12    referenced in function "protected: virtual int __thiscall COpenTsrv::OnInitDialog(void)" (?OnInitDialog@COpenTsrv@@MAEHXZ)  Opentsrv.obj    

I traced it to the referred function but I do not know anything wrong with it ?

BOOL COpenTsrv::OnInitDialog() 
{
CDialog::OnInitDialog();

CenterWindow();


acsEnumServerNames(ST_CSTA, AddToList, (unsigned long) (CComboBox*)&m_TserverListControl);

UpdateData(FALSE);

The following is the build log. Apparently there are still other errors but would like to start with the first one.

1>Generating Code...
1>Compiling resources...
1>Compiling manifest to resources...
1>Linking...
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsEnumServerNames@12  referenced in function "protected: virtual int __thiscall COpenTsrv::OnInitDialog(void)" (? OnInitDialog@COpenTsrv@@MAEHXZ)
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsQueryAuthInfo@8 referenced in function "protected: void __thiscall COpenTsrv::OnSelchangeTserverlist(void)" (?OnSelchangeTserverlist@COpenTsrv@@IAEXXZ)
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsAbortStream@8 referenced in function "protected: virtual void __thiscall COpenTsrv::OnOK(void)" (?OnOK@COpenTsrv@@MAEXXZ)
1>Tsapi.obj : error LNK2001: unresolved external symbol _acsAbortStream@8
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsEventNotify@16 referenced in function "protected: virtual void __thiscall COpenTsrv::OnOK(void)" (?OnOK@COpenTsrv@@MAEXXZ)
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsOpenStream@60 referenced in function "protected: virtual void __thiscall COpenTsrv::OnOK(void)" (?OnOK@COpenTsrv@@MAEXXZ)
1>Opentsrv.obj : error LNK2019: unresolved external symbol _cstaMonitorDevice@20 referenced in function "protected: long __thiscall COpenTsrv::OnTsapiAcsConfirmation(unsigned int,long)" (?OnTsapiAcsConfirmation@COpenTsrv@@IAEJIJ@Z)
1>Sampldlg.obj : error LNK2019: unresolved external symbol _cstaMakeCall@20 referenced in function "protected: void __thiscall CSampleDlg::OnCall(void)" (?OnCall@CSampleDlg@@IAEXXZ)
1>Sampldlg.obj : error LNK2019: unresolved external symbol _cstaClearConnection@16 referenced in function "protected: void __thiscall CSampleDlg::OnHangup(void)" (?OnHangup@CSampleDlg@@IAEXXZ)
1>Sampldlg.obj : error LNK2019: unresolved external symbol _cstaAnswerCall@16 referenced in function "protected: void __thiscall CSampleDlg::OnAnswer(void)" (?OnAnswer@CSampleDlg@@IAEXXZ)
1>Tsapi.obj : error LNK2019: unresolved external symbol _acsGetEventPoll@20 referenced in function "protected: long __thiscall CTsapiWnd::OnTsapiMsg(unsigned int,long)" (?OnTsapiMsg@CTsapiWnd@@IAEJIJ@Z)
1>C:\Users\steventang\Documents\Visual Studio 2005\Projects\TSAPINEW\Debug\TSAPINEW.exe    : fatal error LNK1120: 10 unresolved externals
1>Build log was saved at "file://c:\Users\steventang\Documents\Visual Studio 2005\Projects\TSAPINEW\TSAPINEW\Debug\BuildLog.htm"
1>TSAPINEW - 12 error(s), 21 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Any help to point me to the right direction would very much be appreciated.

Thanks

解决方案

Seems like your compilation was sucessfull. Only the linking did not work.

Probably the linker is complaining because you defined the header of the method "acsEnumServerNames" but you did not provide an implementation of the method.

Maybe you used a header-file but you did not provide the library to which the header belongs ?

Find out to which pakage "acsEnumServerNames" belongs and check if you have the implementation of the method in some .c/.cpp file, or if the implementation should be provided by some library on which you do rely.

这篇关于错误LNK2019未解析的外部符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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