Linking...
LIBCMT.LIB(setlocal.obj) : error LNK2001: unresolved external symbol __imp__Sleep@4
AlertClient.obj : error LNK2001: unresolved external symbol __imp__Sleep@4
Handling.obj : error LNK2001: unresolved external symbol __imp__Sleep@4
main.obj : error LNK2001: unresolved external symbol __imp__Sleep@4
service.obj : error LNK2001: unresolved external symbol __imp__Sleep@4
LIBCMT.LIB(commit.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(read.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(inithelp.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(close.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(drive.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(lseek.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(write.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(osfinfo.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(stat.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(winsig.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(tidtable.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(fullpath.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
service.obj : error LNK2001: unresolved external symbol __imp__GetLastError@0
W32class.obj : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(rename.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LIBCMT.LIB(unlink.obj) : error LNK2001: unresolved external symbol __imp__GetLastError@0
LogEngineServer.obj : error LNK2001: unresolved external symbol __imp__GetLastError@0
LogServerThread.obj : error LNK2001: unresolved external symbol __imp__GetLastError@0
main.obj : error LNK2001: unresolved external symbol __imp__GetLastError@0
ODBCEngine.obj : error LNK2001: unresolved external symbol __imp__GetLastError@0
AlertClient.obj : error LNK2001: unresolved external symbol __imp__GetLastError@0
conn.obj : error LNK2001: unresolved external symbol __imp__GetLastError@0
Handling.obj : error LNK2001: unresolved external symbol __imp__GetLastError@0
LogEngineClient.obj : error LNK2001: unresolved external symbol __imp__GetLastError@0
ODBCEngine.obj : error LNK2001: unresolved external symbol __imp__WaitForSingleObject@8
service.obj : error LNK2001: unresolved external symbol __imp__WaitForSingleObject@8
TimeThread.obj : error LNK2001: unresolved external symbol __imp__WaitForSingleObject@8
W32class.obj : error LNK2001: unresolved external symbol __imp__WaitForSingleObject@8
AlertClient.obj : error LNK2001: unresolved external symbol __imp__WaitForSingleObject@8
conn.obj : error LNK2001: unresolved external symbol __imp__WaitForSingleObject@8
LogServerThread.obj : error LNK2001: unresolved external symbol __imp__WaitForSingleObject@8
main.obj : error LNK2001: unresolved external symbol __imp__WaitForSingleObject@8
conn.obj : error LNK2001: unresolved external symbol __imp__ResetEvent@4
LogEngineServer.obj : error LNK2001: unresolved external symbol __imp__ResetEvent@4
W32class.obj : error LNK2001: unresolved external symbol __imp__ResetEvent@4
conn.obj : error LNK2001: unresolved external symbol __imp__WaitForMultipleObjects@16
LogEngineServer.obj : error LNK2001: unresolved external symbol __imp__WaitForMultipleObjects@16
service.obj : error LNK2001: unresolved external symbol __imp__ReleaseMutex@4

解决方案 »

  1.   

    #include <afx.h>Project -> Settings, 在 Microsoft Foundation Classese 里选择 " Use MFC in a Shared DLL " 或者 " Use MFC in a Static DLL "
      

  2.   

    这就不是CString 类引起的。编译通过。连接出现问题。是指在连接中找不到函数的入口地址,这些函数有:
    Sleep
    ResetEvent
    GetLastError
    WaitForSingleObject
      

  3.   

    还有...Project->Settings... 在 C/C++ 页,在 Category 下拉框里选择 Code Generation,然后在 Use run-time library 里选择 Debug Multithreaded 或者 Multithreaded
      

  4.   

    我已经有个用MFC写好的类CBuffer类其中里面用到的是CString 类,
    我将CBuffer类add to  一个win32 consloe appplication中,编译就
    报这样的错错误bj : error LNK2001: unresolved external symbol "public: char * __thiscall CString::GetBuffer(int)" (?GetBuffer@CString@@QAEPADH@Z)
    buffer.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CFile::~CFile(void)" (??1CFile@@UAE@XZ)
    buffer.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CFile::Close(void)" (?Close@CFile@@UAEXXZ)
    buffer.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CFile::Write(void const *,unsigned int)" (?Write@CFile@@UAEXPBXI@Z)
    buffer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CFile::Open(char const *,unsigned int,class CFileException *)" (?Open@CFile@@UAEHPBDIPAVCFileException@@@Z)
    buffer.obj : error LNK2001: unresolved external symbol "public: __thiscall CFile::CFile(void)" (??0CFile@@QAE@XZ)
    dbug\SMSGRouter.exe : fatal error LNK1120: 7 unresolved externals
    Error executing link.exe.
    Creating browse info file...SMSGRouter.exe - 8 error(s), 0 warning(s)