unresolved external symbol problem

Started by
31 comments, last by _WeirdCat_ 9 years, 10 months ago

By the way my system is X64 is that going to change something???

No, it depends on you build target whether you need to link against die x64 or x86 libraries. It doesn't matter if you're running a x64 or x86 (or something different) OS.
Advertisement

Thanks but how can i solve the problem ?

Adding the dependency to the list is just part of the issue. The compiler/linker still have to be able to find the dependency. If the linker cannot find the library in its search directory, then you will still end up with unresolved symbols even though they were added to the list.

how can i know the linker found it or not ?

i deleted the command : glMultiDrawElements , And i ran the program , it was successful.

how can i now the linker found it or not ?


The linker won't tell whether or not he found the file (although I have no idea why they don't do it). You have to check your linker paths ("Additional Linker Directories" in VS) and see if the path of you libary is included.

yes it is included. i put everything i need in VC directory (in bin, library and include files) and i checked the {VS Directory}/bin and {VS Directory}/library and {VS Directory}/include in Additional Linker Directorys they were linked correctly .

since you have all linked its easy to get it working:

first see this code dont add it to your app

in glew.h




#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements)
GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements;
typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount);

so to get it working: (in your app) (ofc add #include glew.h or in my case gl/glew.h)

in header add:




PFNGLMULTIDRAWELEMENTSPROC  glMultiDrawElements; //name it whatever you want

and in cpp file: you need to initalize it




	glMultiDrawElements = NULL;
	glMultiDrawElements        = (PFNGLMULTIDRAWELEMENTSPROC) wglGetProcAddress("glMultiDrawElements");

be happy its working ;p at least should be

if its still NULL then your card does not support such kind of feature

VC Directory? You are not talking about C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC (or whereever you installed VS) hopefully. I still think that either your library includes are wrong or you are linking against the wrong library. Can you upload the solution so we can take a look at your project settings?

Sry i had a problem with git so i uploaded here :


http://uploadboy.com/kvwp4inyjad4.html

thank you all for your helps !

You have specified the "glew32.lib glew32s.lib" under "Additional Include Directories". First, that is the place where you put the paths where the compiler should look for #include "..." files. Libraries need to go into "Linker\Input\Additional Dependencies". Second, you can't put two libraries, paths, etc. in the same line; use one line per entry or separate the entries with a semicolon.

Also, you should only link glew32.lib or glew32s.lib, not both of them. glew32.lib is for dynamic linking (requires glew32.dll at runtime), glew32s.lib is for static linking (no dll required). If you go for static linking you need to #define GLEW_STATIC before you #include <glew.h>.

This topic is closed to new replies.

Advertisement