使用VC++6.0,创建控制台应用程序,实现输出当前时间,代码如下
#include <iostream>
#include <afx.h>
using namespace std;
int main()
{
CTime ctTime=CTime::GetCurrentTime();
cout<<LPCTSTR(ctTime.Format("%Y-%m-%d %H:%M:%S"))<<endl;
return 0;
}
编译通过,连接时报错:
--------------------Configuration: Taxis - Win32 Debug--------------------
Linking...
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in libcpd.lib(delop.obj)
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/Taxis.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
Taxis.exe - 4 error(s), 1 warning(s)