<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Linker Problem mit VC++ EE 2008 und OpenGl]]></title><description><![CDATA[<p>Hallo,<br />
ich bin nicht sicher ob dieser Beitrag in dieses Forum gehört jedoch passt er hier hin vielleicht am ehesten.</p>
<p>Also ich versuche gerade OpenGL in einem Fenster zu initialisieren (nach Nehe)und bekomme folgende zwei Fehler ausgegeben.</p>
<pre><code>1&gt;Start.obj : error LNK2019: unresolved external symbol &quot;public: int __thiscall OGLScene::InitGL(void)&quot; (?InitGL@OGLScene@@QAEHXZ) referenced in function _WinMain@16

1&gt;Start.obj : error LNK2019: unresolved external symbol &quot;public: void __thiscall OGLScene::ResizeGLScene(int,int)&quot; (?ResizeGLScene@OGLScene@@QAEXHH@Z) referenced in function _WinMain@16
</code></pre>
<p>In den Projekt Einstellungen verweise ich aber auf opengl32.lib sowie glu32.lib, dennoch scheint der Linker probleme damit zu haben.</p>
<p>Kennt jemand die Lösung des Problems?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/227506/linker-problem-mit-vc-ee-2008-und-opengl</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 04:39:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/227506.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 Nov 2008 11:56:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Linker Problem mit VC++ EE 2008 und OpenGl on Sun, 16 Nov 2008 11:56:15 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich bin nicht sicher ob dieser Beitrag in dieses Forum gehört jedoch passt er hier hin vielleicht am ehesten.</p>
<p>Also ich versuche gerade OpenGL in einem Fenster zu initialisieren (nach Nehe)und bekomme folgende zwei Fehler ausgegeben.</p>
<pre><code>1&gt;Start.obj : error LNK2019: unresolved external symbol &quot;public: int __thiscall OGLScene::InitGL(void)&quot; (?InitGL@OGLScene@@QAEHXZ) referenced in function _WinMain@16

1&gt;Start.obj : error LNK2019: unresolved external symbol &quot;public: void __thiscall OGLScene::ResizeGLScene(int,int)&quot; (?ResizeGLScene@OGLScene@@QAEXHH@Z) referenced in function _WinMain@16
</code></pre>
<p>In den Projekt Einstellungen verweise ich aber auf opengl32.lib sowie glu32.lib, dennoch scheint der Linker probleme damit zu haben.</p>
<p>Kennt jemand die Lösung des Problems?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1615472</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1615472</guid><dc:creator><![CDATA[knitte]]></dc:creator><pubDate>Sun, 16 Nov 2008 11:56:15 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Problem mit VC++ EE 2008 und OpenGl on Sun, 16 Nov 2008 12:29:34 GMT]]></title><description><![CDATA[<p>Wo kommen denn die OGLScene::InitGL und OGLScene::ResizeGLScene her? Selbstgemacht? Dann fehlt dir die Definition. Aus einer anderen Lib? Dann fehlt dir eben diese. Beide sind mir unter Windows noch nicht begegnet.</p>
<p>Zeig mal den ganzen Code, dann kann man es besser abschätzen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1615485</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1615485</guid><dc:creator><![CDATA[mad_martin]]></dc:creator><pubDate>Sun, 16 Nov 2008 12:29:34 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Problem mit VC++ EE 2008 und OpenGl on Sun, 16 Nov 2008 12:59:11 GMT]]></title><description><![CDATA[<p>Hi,<br />
das ist meine OGLScene Klasse:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;GL\gl.h&gt;			// Header File For The OpenGL32 Library
#include &lt;GL\glu.h&gt;			// Header File For The GLu32 Library

class OGLScene{

public:
	OGLScene(){}
	~OGLScene(){}

	int InitGL(GLvoid){										// All Setup For OpenGL Goes Here
		glShadeModel(GL_SMOOTH);							// Enable Smooth Shading
		glClearColor(0.0f, 0.0f, 0.0f, 0.5f);				// Black Background
		glClearDepth(1.0f);									// Depth Buffer Setup
		glEnable(GL_DEPTH_TEST);							// Enables Depth Testing
		glDepthFunc(GL_LEQUAL);								// The Type Of Depth Testing To Do
		glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);	// Really Nice Perspective Calculations
		return TRUE;										// Initialization Went OK
	}

	GLvoid ResizeGLScene(GLsizei width, GLsizei height){		// Resize And Initialize The GL Window
		if (height==0){										// Prevent A Divide By Zero By
			height=1;										// Making Height Equal One
		}

		glViewport(0,0,width,height);						// Reset The Current Viewport

		glMatrixMode(GL_PROJECTION);						// Select The Projection Matrix
		glLoadIdentity();									// Reset The Projection Matrix

		// Calculate The Aspect Ratio Of The Window
		gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);

		glMatrixMode(GL_MODELVIEW);							// Select The Modelview Matrix
		glLoadIdentity();									// Reset The Modelview Matrix
	}

};
</code></pre>
<p>und das die Start Datei:</p>
<pre><code>#include &lt;windows.h&gt;
#include &quot;OGLScene.h&quot;

const char g_szClassName[] = &quot;myWindowClass&quot;;

OGLScene oglScene;

// Step 4: the Window Procedure
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
        case WM_CLOSE:
            DestroyWindow(hwnd);
        break;
        case WM_DESTROY:
            PostQuitMessage(0);
        break;
        default:
            return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{
    WNDCLASSEX wc;
    HWND hwnd;
    MSG Msg;

    //Step 1: Registering the Window Class
    wc.cbSize        = sizeof(WNDCLASSEX);
    wc.style         = 0;
    wc.lpfnWndProc   = WndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = g_szClassName;
    wc.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);

    if(!RegisterClassEx(&amp;wc))
    {
        MessageBox(NULL, &quot;Window Registration Failed!&quot;, &quot;Error!&quot;,
            MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }

    // Step 2: Creating the Window
    hwnd = CreateWindowEx(
        WS_EX_CLIENTEDGE,
        g_szClassName,
        &quot;Open GL Programming&quot;,
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
        NULL, NULL, hInstance, NULL);

    if(hwnd == NULL)
    {
        MessageBox(NULL, &quot;Window Creation Failed!&quot;, &quot;Error!&quot;,
            MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }

    ShowWindow(hwnd, nCmdShow);
	oglScene.ResizeGLScene(640,480);
	oglScene.InitGL();

    UpdateWindow(hwnd);

    // Step 3: The Message Loop
    while(GetMessage(&amp;Msg, NULL, 0, 0) &gt; 0)
    {
        TranslateMessage(&amp;Msg);
        DispatchMessage(&amp;Msg);
    }
    return Msg.wParam;
}
</code></pre>
<p>Ich musste in der Opengl Klasse auch die windows.h includen, und weiss nicht wieso. Sonst würde die Datei nicht kompilieren</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1615500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1615500</guid><dc:creator><![CDATA[knitte]]></dc:creator><pubDate>Sun, 16 Nov 2008 12:59:11 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Problem mit VC++ EE 2008 und OpenGl on Sun, 16 Nov 2008 16:14:15 GMT]]></title><description><![CDATA[<p>Den Windows.h-Inklude kannste schonmal aus der Main.cpp rausnehmen. Vielleicht hat er ja auch was gegen die Deklarierung in der Klasse, schau mal ob's so geht:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;GL\gl.h&gt;            
#include &lt;GL\glu.h&gt;            

class OGLScene
{

public:
    OGLScene(){}
    ~OGLScene(){}

    int InitGL(GLvoid);

    GLvoid ResizeGLScene(GLsizei width, GLsizei height);
}; 

int OGLScene::InitGL(GLvoid)
{
        glShadeModel(GL_SMOOTH);                            
        glClearColor(0.0f, 0.0f, 0.0f, 0.5f);                
        glClearDepth(1.0f);                                   
        glEnable(GL_DEPTH_TEST);                            
        glDepthFunc(GL_LEQUAL);                                
        glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);   
        return TRUE;   
};

GLvoid OGLScene::ResizeGLScene(GLsizei width, GLsizei height)
{
     if (height==0)
	{                                        // Prevent A Divide By Zero By
            height=1;                                        // Making Height Equal One
        }

        glViewport(0,0,width,height);                        // Reset The Current Viewport

        glMatrixMode(GL_PROJECTION);                        // Select The Projection Matrix
        glLoadIdentity();                                    // Reset The Projection Matrix

        // Calculate The Aspect Ratio Of The Window
        gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);

        glMatrixMode(GL_MODELVIEW);                            // Select The Modelview Matrix
        glLoadIdentity();      
 };
</code></pre>
<p>Achja, was mir gerade auch aufgefallen ist, du inkludierst ja über &quot;GL/...&quot;, ist das richtig? Prüf doch mal ob du das hier kompilieren kannst:<br />
<a href="http://nehe.gamedev.net/data/lessons/vc/lesson01.zip" rel="nofollow">http://nehe.gamedev.net/data/lessons/vc/lesson01.zip</a><br />
Falls ja, pack dir die Header in dein Program. Falls nicht, änder sie um und schau ob's so geht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1615583</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1615583</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Sun, 16 Nov 2008 16:14:15 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Problem mit VC++ EE 2008 und OpenGl on Mon, 17 Nov 2008 14:01:44 GMT]]></title><description><![CDATA[<p>Hi,<br />
vielen Dank, jetzt funktioniert es! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1615972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1615972</guid><dc:creator><![CDATA[knitte]]></dc:creator><pubDate>Mon, 17 Nov 2008 14:01:44 GMT</pubDate></item></channel></rss>