Я пытаюсь построить openFrameworks 0.9.0 с помощью Visual Studio 2015 и получаю «компиляцию сбоев абстрактного класса». Тем не менее, я считаю, что это скорее проблема синтаксиса VS2015 по сравнению с проблемой openFrameworks. Этот код построен с использованием Visual Studio 2012 и openFrameworks 0.8.4. Кто-нибудь знает, как должен выглядеть синтаксис класса реализации для удовлетворения VS2015?Visual Studio 2015 «невозможно создать экземпляр абстрактного класса» скомпилировать сбои build openFrameworks 0.9.0
Ошибки из VS2015 компиляции являются:
ofx*.cpp(46): error C2259: 'ofx*': cannot instantiate abstract class 1> ......\addons\ofx*I\libs\src\ofx*.cpp(46): note: due to following members: 1> ......\addons\ofx*I\libs\src\ofx*.cpp(46): note: 'void ofBaseDraws::draw(float,float,float,float) const': is abstract 1> ...of_v0.9.0_vs_release\libs\openFrameworks\types\ofBaseTypes.h(75): note: see declaration of 'ofBaseDraws::draw'
1> ......\addons\ofx*I\libs\src\ofx*.cpp(46): note: 'void ofBaseDraws::draw(float,float) const': is abstract 1> ...of_v0.9.0_vs_release\libs\openFrameworks\types\ofBaseTypes.h(67): note: see declaration of 'ofBaseDraws::draw'
1> ......\addons\ofx*I\libs\src\ofx*.cpp(46): note: 'float ofBaseDraws::getHeight(void) const': is abstract 1> ...of_v0.9.0_vs_release\libs\openFrameworks\types\ofBaseTypes.h(104): note: see declaration of 'ofBaseDraws::getHeight'
1> ......\addons\ofx*I\libs\src\ofx*.cpp(46): note: 'float ofBaseDraws::getWidth(void) const': is abstract 1> ...of_v0.9.0_vs_release\libs\openFrameworks\types\ofBaseTypes.h(108): note: see declaration of 'ofBaseDraws::getWidth'
Код из унаследованного класса: of_v0.9.0_vs_release \ LIBS \ openFrameworks \ типы \ ofBaseTypes.h
имеет абстрактный объект: ofBaseDraws ... который имеет следующие объявления:
/// \brief Draw at a position at the native size.
///
/// Native size is determined by getWidth() and getHeight().
///
/// \param x Draw position on the x axis.
/// \param y Draw position on the y axis.
virtual void draw(float x, float y) const=0;
/// \brief Draw at a position with the specified size.
///
/// \param x Draw position on the x axis.
/// \param y Draw position on the y axis.
/// \param w Draw width.
/// \param h Draw height.
virtual void draw(float x, float y, float w, float h) const=0;
выглядит следующим образом:
/// \brief Draw at a position at the native size.
///
/// Native size is determined by getWidth() and getHeight().
///
/// \param x Draw position on the x axis.
/// \param y Draw position on the y axis.
virtual void draw(float x, float y) const=0;
/// \brief Draw at a position with the specified size.
///
/// \param x Draw position on the x axis.
/// \param y Draw position on the y axis.
/// \param w Draw width.
/// \param h Draw height.
virtual void draw(float x, float y, float w, float h) const=0;
...............................................
/// \brief Get the height.
/// \returns the height.
virtual float getHeight() const = 0;
/// \brief Get the width.
/// \returns the width.
virtual float getWidth() const = 0;
В openFrameworks 0.8.4 код, который построен с VS2012 был немного отличается:
virtual void draw(float x, float y)=0;
virtual void draw(float x, float y, float w, float h)=0;
...............................................
virtual float getHeight()=0;
virtual float getWidth()=0;
Найдено конвенций в: o f_v0.9.0_vs_release \ ЛИЭС \ openFrameworks \ ГЛ \ ofTexture.h: – tintelsof