On terça-feira, 17 de dezembro de 2013 09:49:48, Yves Bailly wrote: > (1) > When I try to build this program, I get a link error: > gl_widget.obj : error LNK2019: symbole externe non résolu "protected: bool > __cdecl QAbstractOpenGLFunctions::isInitialized(void)const " > (?isInitialized@QAbstractOpenGLFunctions@@IEBA_NXZ) référencé dans la > fonction "protected: virtual void __cdecl Gl_Widget::initializeGL(void)" > (?initializeGL@Gl_Widget@@MEAAXXZ) > > ...which basically says the external symbol > QAbstractOpenGLFunctions::isInitialized() could not be resolved. > If I remove the "if" line, thus not calling isInitialized(), everything > works fine. I even tried to force name resolution with "if (not > this->QOpenGLFunctions_3_3_Core::isInitialized())", but no luck. > > Any idea about what can go wrong?
Yes: you're calling a function that is not public. Stop calling isInitialized(). > To alleviate those points, I tried something like this (with various > variations and more sanity checks): > class My_Class: public > Some_Other_Super, protected QOpenGLFunctions_3_3_Core { > void some_init_method() > { > QOpenGLContext* ctx = QOpenGLContext::currentContext(); > QOpenGLFunctions_3_3_Core* funcs = > ctx->versionFunctions<QOpenGLFunctions_3_3_Core>(); > dynamic_cast<QOpenGLFunctions_3_3_Core&>(*this) = *funcs; > } > } Why are you trying to initialize like that? You should simply call initializeOpenGLFunctions(). -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest