realLiXunhua 2021-07-15 17:17 采纳率: 80%
浏览 44
已结题

void函数debug报错must return a value?

void cOSG::Render(void ptr)
{
cOSG* osg = (cOSG*)ptr;

osgViewer::Viewer* viewer = osg->getViewer();

// You have two options for the main viewer loop
//      viewer->run()   or
//      while(!viewer->done()) { viewer->frame(); }

//viewer->run();
while(!viewer->done())
{
    osg->PreFrameUpdate();
    viewer->frame();
    osg->PostFrameUpdate();
    //Sleep(10);         // Use this command if you need to allow other processes to have cpu time
}

// For some reason this has to be here to avoid issue:
// if you have multiple OSG windows up
// and you exit one then all stop rendering

// AfxMessageBox("Exit Rendering Thread");

_endthread();

}

debug提示:error C4716: 'cOSG::Render' : must return a value

  • 写回答

1条回答 默认 最新

  • qfl_sdu 2021-07-15 17:20
    关注

    看看.h文件中声明的Render函数的返回值是什么类型,跟你贴出来的是否一致。
    这种问题一般就是.h和.cpp的函数返回值类型不一致导致的。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 8月24日
  • 已采纳回答 8月16日
  • 创建了问题 7月15日

悬赏问题

  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)