Jump to content

  • Log In with Google      Sign In   
  • Create Account

Problem linking to Glew on Windows 64 bit and Visual Studio 2010


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 mrjixan   Members   -  Reputation: 104

Like
0Likes
Like

Posted 14 November 2012 - 09:14 PM

I'm having a problem linking to glew in vs 2010, looking on google it seems a few other people have had similar issues running Glew on 64 bit windows.

I have my project linked to the glew32.lib and freeglut.lib. Freeglut is working without problem, so the libs and headers are all in the right place. Running my program gives me a bunch of "unresolved external symbol" errors to various glew functions. I have tried building Glew from source, which seems to have fixed similar issues for other people, but no joy. Does anyone have any other suggestions for things I could try before I give up?

Sponsor:

#2 BitMaster   Crossbones+   -  Reputation: 4432

Like
0Likes
Like

Posted 15 November 2012 - 05:07 AM

When you say "unresolved external symbol", I assume you are referring to the linker error? In that case, you are not "running your program", the IDE tries to compile it but fails at the linking stage. The most likely scenario is either not telling the linker to link to the library (with #pragma or in the linker options) or you try to link to an x86 library (in my experience the linker accepts a x86 library in x64 projects but just does not load any symbols from there).

That said, when describing a problem, always report any errors as verbatim as possible. Never paraphrase them.

Edited by BitMaster, 15 November 2012 - 05:08 AM.


#3 Koehler   Members   -  Reputation: 228

Like
0Likes
Like

Posted 15 November 2012 - 09:36 AM

You've probably tried some of this already, but here are some possibilities.

If this is happening when you actually run, then you need to place the glew32.dll where your OS can find it (Same dir as your executable would work, which is <Solution dir>\Debug or <Solution dir>\Release.

If you're trying to link statically with glew, you'll need to link to glew32s.lib (for release) and glew32sd.lib (for debug).

Finally, check and see if the first error isn't something like "Couldn't find library glew32.lib". If that's the case, you need to tell the linker about the folder your glew32.lib is in. (Project properties -> Linker -> General, modify "Additional library locations")

Edited by Koehler, 15 November 2012 - 09:37 AM.


#4 mrjixan   Members   -  Reputation: 104

Like
0Likes
Like

Posted 17 November 2012 - 12:10 PM

Thanks for the responses guys, I managed to fix it in the end, by putting all the headers and libs in Program Files(x86)/Microsoft SDKs/Windows/v7.0A, and removing them from the VC 2010 include and lib directories. I had assumed that the headers and libs could be in either place, perhaps this is not the case.

#5 nonsenseinc   Members   -  Reputation: 102

Like
0Likes
Like

Posted 18 November 2012 - 02:31 AM

I also use glew on Visual Studio and compile for x86 and x64. I ran into the same problem and I fixed it by adding GLEW_STATIC to the preprocessor variables (you can also add a #define) and put the includes in my project folder and added the glew.c to my project. In a way I am not using it as a library but include it directly in my code. I would gladly provide a project template as I see many people run into this problem, but I have a different error that currently blocks my project. If you want I can upload it later...




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS