询问编译错误原因?

No9 2000-09-13 04:44:00
最近我下载了一个程序,里面没有发现__beginthreadex和__endthreadex的定义或者引用,
但在编译时却发生如下的错误:
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/FileChange.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
我想知道这是为什么,如何对它进行修改呢?
谢谢!
...全文
129 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
No9 2001-10-19
  • 打赏
  • 举报
回复
开始加分!
No9 2001-10-19
  • 打赏
  • 举报
回复
算了,这个问题已经没有用了!
谢谢三位的参与,分数平分了吧!
600000 2001-10-17
  • 打赏
  • 举报
回复
凑个热闹!
我以前也碰到过,也想知道!
Up 一下!
bigjim 2000-09-14
  • 打赏
  • 举报
回复
Msdn的q124666详细阐述了这个问题。下面是其中的一部分。
CAUSE
Starting with version 3.0, all MFC classes are "thread safe" and require the multi-threaded run-time libraries to link successfully. Many people try to use the single-threaded run-time libraries because they assume these libraries are needed to enable the application to run in Win32s. This is not the case. MFC versions 3.0 and later will use a single thread, so as long as you are not creating additional threads in the application, the application will run under Win32s.
RESOLUTION
To avoid these unresolved external errors, do not set the Project Settings to Single-Threaded for an MFC version 3.0 or later application. This setting can be changed by doing the following:

On Visual C 2.x and 5.0:


Select the PROJECT menu (and continue Steps 2 through 5 below).

On Visual C 4.x:

Select the Build menu.

Select the SETTINGS... option.

Select the tab, C/C++.

Select CODE GENERATION on the Category list box.

Finally, make a selection other than SINGLE-THREADED on the Use Run Time Library list box.
应该看懂了吧,那么,把单线程该为多线程试试。
坎坷的菜贩 2000-09-13
  • 打赏
  • 举报
回复
下载的程序?是不是只有源文件,而缺少某些工程文件,所以你新建一Win32 application工程,再将源文件加入工程编译?如果这样的话,需要用Alt-F7重新设置编译方式,将Not using MFC改为use MFC in a shared DLL就OK了。

16,467

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧