错误LNK2019解析的外部符号(error LNK2019 unresolved external

2019-06-27 21:33发布

我很新的C ++,所以我下载了一个示例C ++程序。 示例程序似乎砸当编译以下错误: -

Error   22  error LNK2019: unresolved external symbol _acsEnumServerNames@12    referenced in function "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>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 ==========

任何帮助,我指向正确的方向将非常可以理解的。

谢谢

Answer 1:

好像你的编译是sucessfull。 只有链接没有工作。

也许接头抱怨,因为你所定义的方法“acsEnumServerNames”的头,但你没有提供该方法的实现。

也许你使用的头文件,但你没有提供给这头所属的图书馆吗?

找出哪个PAKAGE“acsEnumServerNames”属于和检查,如果你有方法的实现,在一些.C / .cpp文件,或者如果实现,应该由其他图书馆提供在其上做依托。



文章来源: error LNK2019 unresolved external symbol