Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
143 views
in Technique[技术] by (71.8m points)

c++ - error LNK2019 unresolved external symbol

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:UserssteventangDocumentsVisual Studio 2005ProjectsTSAPINEWDebugTSAPINEW.exe    : fatal error LNK1120: 10 unresolved externals
1>Build log was saved at "file://c:UserssteventangDocumentsVisual Studio 2005ProjectsTSAPINEWTSAPINEWDebugBuildLog.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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...