The solution was first provided by abeylin (post #14).
Giving a direct "link" to the lib solved by problem. In this case I opted to change from #pragma comment to using the additional dependences in the project properties and added the full path to the .lib (in my case "d:/programming/libs/glew32.lib").
A big thanks to the people having helped me with this and made many things clearer for me (where to place lib's and why you can't place dll's in other folders than the project "root" or in the windows system folders.
Thanks for all the great help!
___________________________________
Hi all.
I've been trying for some time now to get GLEW to function correctly in VC++ 2010. I have no problems with this project in the older version i used to program in.
I get the following:
error LNK2001: unresolved external symbol __imp____wglewCreateContextAttribsARB
error LNK2019: unresolved external symbol __imp__wglewIsSupported referenced in function "public: bool __thiscall oglContext::create30Context(struct HWND__ *)" (?create30Context@oglContext@@QAE_NPAUHWND__@@@Z)
error LNK2019: unresolved external symbol __imp__glewInit referenced in function "public: bool __thiscall oglContext::create30Context(struct HWND__ *)" (?create30Context@oglContext@@QAE_NPAUHWND__@@@Z)
I know what an unresolved external symbol error is but this time I just don't know how to solve it.
When I compile my program. I've pragma commented the glew and opengl libraries in my main.h file:
#pragma once
// windowsfunktioner
#include <windows.h>
// input och output
#include <iostream>
// opengl och glew
#include <gl/glew.h>
#include <gl/wglew.h>
#pragma comment(lib, "glew32.lib")
#pragma comment(lib, "opengl32.lib")
Should the libs be located somewhere special? I mean other than the lib-folder in "Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib"?
I've included this file in the header file used by the document that is giving these errors (opengl.h)
#include "main.h"
class oglContext {
public:
...
And this header file is included in the opengl.cpp file that is giving the errors.
I think the compiler is complaining about the following lines:
GLenum error = glewInit();
if(wglewIsSupported("WGL_ARB_create_context") == 1){
hrc = wglCreateContextAttribsARB(hdc, NULL, attributes);
...
}
I'm out of ideas. Do you guys know why I'm getting these errors?
Thanks,
Marcus Axelsson