当前位置:首页 » 多媒体相关

求助------编译错误-“_beginthreadex”:“未声明的标识符”


下载了一个源代码,能正常编译。但自己仿照自己写一个时,却不能正常编译。  
   
   
  源代码中首先是作如下定义:  
  ////test.h  
  ........(略)  
  #include<process.h>  
   
  ........(略)  
   
  #define   beginpeerthread(pfnstartaddr,pvparam,pdwthreadid)\  
  ((handle)(_beginthreadex((void*)null,\  
                                                                    0,\  
    (pthread_start)(pfnstartaddr),\  
    (void*)(pvparam),\  
    0,\  
    (unsigned*)(pdwthreadid)\  
  )\  
                                    )\  
  )  
   
  #define   endpeerthread(retval)   _endthreadex((unsigned)retval)  
   
  //////test.cpp  
   
  ........(略)  
   
  if((hnewthread=beginpeerthread(serverthread,&connectsocketinfo  
  ,&dwnewthreadid))==null)///////就是这一句发生了错误,即下面说的117行  
   
  ........(略)  
   
  但是编译是却发生错误:d:\maproject\test\test.cpp(117):   error   c2065:   “_beginthreadex”   :   未声明的标识符.                          
   
  可是我已经加了#include<process.h>这一句了呀。是不是beginpeerthread()的定义有问题还是其他什么地方出了问题?  
 

推荐阅读

  • eBay2006年揽才数百人 研发中心规模翻倍 [详细内容]
  • 宇瞻科技推出DDR2环保内存模块 [详细内容]
  • 摄像时间12秒可以改吗? [详细内容]
  • 网通04年盈利未出预期 市场关注分拆联通看法 [详细内容]
  • 智能SFP光模块数据诊断功能的应用 [详细内容]
  • 7260新手必读(二) [详细内容]
  • 后过渡期是外资进入我国基础电信的活动期 [详细内容]
  • 网友回答:
    网友:opentuxedo

    是不是建立了一个不支持多线程的项目,#include"process.h"前面#define   _mt试一下

    网友:huxzjqhh

    按alt+f7,在c/c++选项下的   code   generation里选debug   multithreaded   看看.

    .

    讨论区

    Login