注册 登录
编程论坛 C++教室

读txt

jianweichief 发布于 2008-01-03 22:22, 714 次点击
创建的一个console程序,一直报错,高手给看看啊!

#include "afx.h"
#include "iostream.h"
#include "afxwin.h"

void main()
{
    CStdioFile file;
    if (file.Open("h:\\book\my project\CFileOpen\a.txt",CFile::modeRead))
    {
        CString str;
        for (;file.ReadString(str);)
        {
            AfxMessageBox(str);
        }
    }
}


错误提示:
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/newone.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

newone.exe - 3 error(s), 0 warning(s)
谢谢大家了!
1 回复
#2
jiangzw6252008-01-07 18:12
回复 1# 的帖子
应该是缺少链接选项,你应该把多线程选项和MFC库连进去。

[[italic] 本帖最后由 jiangzw625 于 2008-1-7 18:14 编辑 [/italic]]
1