<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Maya C++ OpenGL linker issues in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-c-opengl-linker-issues/m-p/12347908#M706</link>
    <description>&lt;P&gt;Hey everyone!&lt;BR /&gt;I hope you are all doing well)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I wanted to ask a question about Maya C++ plugin building. I'm currently struggling with an issue I can't resolve for a couple of days.&lt;BR /&gt;&lt;BR /&gt;I created a custom context with manips, and it is working and building very well, but at some point, I needed to create a small QDialog with QT libraries, which uses OpenGL, and this is my main issue. I downloaded Maya Devkit, added a linker and include libs.&lt;/P&gt;&lt;P&gt;I also tried to use FindMaya_Qt.cmake from the Autodesk USD repository. But I can't go over a linker error, which appears during compilation.It seems to me that some DLLs or libraries are missing, but I don't get which one. Maybe someone had a similar issue?&lt;/P&gt;&lt;P&gt;I also tried to add opengl32.dll but it doesn't do nothing. It seems to me that something is wrong with my Qt config, or cpp class which uses OpenGL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my errors from Visual studio:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol __imp_glViewport referenced in function "protected: virtual void __cdecl DebugRenderer::resizeGL(int,int)" (?resizeGL@DebugRenderer@@MEAAXHH@Z) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1

Error LNK2019 unresolved external symbol __imp_glBegin referenced in function "protected: virtual void __cdecl DebugRenderer::paintGL(void)" (?paintGL@DebugRenderer@@MEAAXXZ) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1

Error LNK2019 unresolved external symbol __imp_glClear referenced in function "protected: virtual void __cdecl DebugRenderer::paintGL(void)" (?paintGL@DebugRenderer@@MEAAXXZ) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1

Error LNK2019 unresolved external symbol __imp_glClearColor referenced in function "protected: virtual void __cdecl DebugRenderer::initializeGL(void)" (?initializeGL@DebugRenderer@@MEAAXXZ) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1

Error LNK2019 unresolved external symbol __imp_glColor3f referenced in function "protected: virtual void __cdecl DebugRenderer::paintGL(void)" (?paintGL@DebugRenderer@@MEAAXXZ) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1

Error LNK2019 unresolved external symbol __imp_glEnd referenced in function "protected: virtual void __cdecl DebugRenderer::paintGL(void)" (?paintGL@DebugRenderer@@MEAAXXZ) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1

Error LNK2019 unresolved external symbol __imp_glVertex3f referenced in function "protected: virtual void __cdecl DebugRenderer::paintGL(void)" (?paintGL@DebugRenderer@@MEAAXXZ) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And also, class which gives me an error:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#pragma once

#include &amp;lt;reactphysics3d/reactphysics3d.h&amp;gt;
#include &amp;lt;maya/MQtUtil.h&amp;gt;
#include &amp;lt;QtWidgets/qdialog.h&amp;gt;
#include &amp;lt;QtWidgets/QVBoxLayout&amp;gt;
#include &amp;lt;QtOpenGL/qglfunctions.h&amp;gt;
#include &amp;lt;QtGui/QOpenGLFunctions&amp;gt;
#include &amp;lt;QtWidgets/QOpenGLWidget&amp;gt;
#include &amp;lt;GL/gl.h&amp;gt;
#include &amp;lt;QtGui/qopenglext.h&amp;gt;


class DebugRenderer : public QOpenGLWidget, protected QOpenGLFunctions {  // Updated inheritance
public:
    DebugRenderer(rp3d::PhysicsWorld* physicsWorld, QWidget* parent = nullptr);

protected:
    void initializeGL() override;
    void resizeGL(int w, int h) override;
    void paintGL() override;

private:
    rp3d::PhysicsWorld* physicsWorld;
};

class DebugDialog : public QDialog {
public:
    DebugDialog(rp3d::PhysicsWorld* physicsWorld, QWidget* parent = nullptr);
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Nov 2023 23:50:38 GMT</pubDate>
    <dc:creator>golubevcg</dc:creator>
    <dc:date>2023-11-01T23:50:38Z</dc:date>
    <item>
      <title>Maya C++ OpenGL linker issues</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-c-opengl-linker-issues/m-p/12347908#M706</link>
      <description>&lt;P&gt;Hey everyone!&lt;BR /&gt;I hope you are all doing well)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I wanted to ask a question about Maya C++ plugin building. I'm currently struggling with an issue I can't resolve for a couple of days.&lt;BR /&gt;&lt;BR /&gt;I created a custom context with manips, and it is working and building very well, but at some point, I needed to create a small QDialog with QT libraries, which uses OpenGL, and this is my main issue. I downloaded Maya Devkit, added a linker and include libs.&lt;/P&gt;&lt;P&gt;I also tried to use FindMaya_Qt.cmake from the Autodesk USD repository. But I can't go over a linker error, which appears during compilation.It seems to me that some DLLs or libraries are missing, but I don't get which one. Maybe someone had a similar issue?&lt;/P&gt;&lt;P&gt;I also tried to add opengl32.dll but it doesn't do nothing. It seems to me that something is wrong with my Qt config, or cpp class which uses OpenGL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my errors from Visual studio:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol __imp_glViewport referenced in function "protected: virtual void __cdecl DebugRenderer::resizeGL(int,int)" (?resizeGL@DebugRenderer@@MEAAXHH@Z) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1

Error LNK2019 unresolved external symbol __imp_glBegin referenced in function "protected: virtual void __cdecl DebugRenderer::paintGL(void)" (?paintGL@DebugRenderer@@MEAAXXZ) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1

Error LNK2019 unresolved external symbol __imp_glClear referenced in function "protected: virtual void __cdecl DebugRenderer::paintGL(void)" (?paintGL@DebugRenderer@@MEAAXXZ) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1

Error LNK2019 unresolved external symbol __imp_glClearColor referenced in function "protected: virtual void __cdecl DebugRenderer::initializeGL(void)" (?initializeGL@DebugRenderer@@MEAAXXZ) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1

Error LNK2019 unresolved external symbol __imp_glColor3f referenced in function "protected: virtual void __cdecl DebugRenderer::paintGL(void)" (?paintGL@DebugRenderer@@MEAAXXZ) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1

Error LNK2019 unresolved external symbol __imp_glEnd referenced in function "protected: virtual void __cdecl DebugRenderer::paintGL(void)" (?paintGL@DebugRenderer@@MEAAXXZ) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1

Error LNK2019 unresolved external symbol __imp_glVertex3f referenced in function "protected: virtual void __cdecl DebugRenderer::paintGL(void)" (?paintGL@DebugRenderer@@MEAAXXZ) maya_plugin C:\Users\golub\Documents\maya_plugin\build\src\debugDialog.obj 1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And also, class which gives me an error:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#pragma once

#include &amp;lt;reactphysics3d/reactphysics3d.h&amp;gt;
#include &amp;lt;maya/MQtUtil.h&amp;gt;
#include &amp;lt;QtWidgets/qdialog.h&amp;gt;
#include &amp;lt;QtWidgets/QVBoxLayout&amp;gt;
#include &amp;lt;QtOpenGL/qglfunctions.h&amp;gt;
#include &amp;lt;QtGui/QOpenGLFunctions&amp;gt;
#include &amp;lt;QtWidgets/QOpenGLWidget&amp;gt;
#include &amp;lt;GL/gl.h&amp;gt;
#include &amp;lt;QtGui/qopenglext.h&amp;gt;


class DebugRenderer : public QOpenGLWidget, protected QOpenGLFunctions {  // Updated inheritance
public:
    DebugRenderer(rp3d::PhysicsWorld* physicsWorld, QWidget* parent = nullptr);

protected:
    void initializeGL() override;
    void resizeGL(int w, int h) override;
    void paintGL() override;

private:
    rp3d::PhysicsWorld* physicsWorld;
};

class DebugDialog : public QDialog {
public:
    DebugDialog(rp3d::PhysicsWorld* physicsWorld, QWidget* parent = nullptr);
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 23:50:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-c-opengl-linker-issues/m-p/12347908#M706</guid>
      <dc:creator>golubevcg</dc:creator>
      <dc:date>2023-11-01T23:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Maya C++ OpenGL linker issues</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-c-opengl-linker-issues/m-p/12370773#M707</link>
      <description>&lt;P&gt;Small update about this issue - I was able to resolve it with help from others.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;After I added this cmake into my build:&lt;BR /&gt;include($ENV{DEVKIT_LOCATION}/cmake/pluginEntry.cmake)&lt;/P&gt;&lt;P&gt;And launched function, which is stored inside this cmake:&lt;BR /&gt;build_plugin()&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It fetched some additional dependencies, and I could build &amp;amp; compile it correctly.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 15:33:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-c-opengl-linker-issues/m-p/12370773#M707</guid>
      <dc:creator>golubevcg</dc:creator>
      <dc:date>2023-11-11T15:33:26Z</dc:date>
    </item>
  </channel>
</rss>

