CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

询问编译错误原因?

楼主No9(华龙)2000-09-13 16:44:00 在 VC/MFC / 基础类 提问

最近我下载了一个程序,里面没有发现__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.  
  我想知道这是为什么,如何对它进行修改呢?  
  谢谢!  
  问题点数:30、回复次数:4Top

1 楼a8e(坎坷的菜贩)回复于 2000-09-13 17:53:00 得分 10

下载的程序?是不是只有源文件,而缺少某些工程文件,所以你新建一Win32   application工程,再将源文件加入工程编译?如果这样的话,需要用Alt-F7重新设置编译方式,将Not   using   MFC改为use   MFC   in   a   shared   DLL就OK了。Top

2 楼bigjim(飞翔鸟)回复于 2000-09-14 08:50:00 得分 10

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.    
  应该看懂了吧,那么,把单线程该为多线程试试。Top

3 楼600000(前 DOS 高手)回复于 2001-10-17 10:18:26 得分 10

凑个热闹!  
  我以前也碰到过,也想知道!  
  Up   一下!Top

4 楼No9(华龙)回复于 2001-10-19 11:48:32 得分 0

算了,这个问题已经没有用了!  
  谢谢三位的参与,分数平分了吧!Top

5 楼No9(华龙)回复于 2001-10-19 11:49:25 得分 0

开始加分!Top

相关问题

  • 编译错误!什么原因?
  • 编译错误
  • 编译错误!!
  • 编译错误??
  • 编译错误!!
  • 编译错误???
  • 编译错误
  • 编译错误
  • 编译错误 !
  • 编译错误

关键词

  • win32
  • 编译
  • mfc
  • application
  • unresolved external
  • single
  • threaded
  • 工程
  • version3.0
  • run

得分解答快速导航

  • 帖主:No9
  • a8e
  • bigjim
  • 600000

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo