前言
今天從書上抄來的代碼,抄好后運行出錯,一直以為我在代碼抄寫的過程中出了問題,或者書上的代碼本身有問題。錯誤截圖如下:
解決
書中原代碼為
#include <osgdb/ReadFile>
#include <osgViewer/Viewer>
#include <osg/Group>
#include <osgFX/Scribe>
#include <osgGA/GUIEventHandler>
#include <osgUtil/LineSegmentIntersector>
在首行添加
#include <Windows.h>