Jump to content

  • Log In with Google      Sign In   
  • Create Account

unresolved external symbol problem


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
32 replies to this topic

#21 Levent Cpp   Members   -  Reputation: 143

Like
0Likes
Like

Posted 03 June 2014 - 12:41 PM

Did you compile it successfully? cause i removed glew32s.lib and put the glew32.lib in Linker > Input > Dependencies and i face the same error as before.



Sponsor:

#22 Jan2go   Members   -  Reputation: 959

Like
1Likes
Like

Posted 03 June 2014 - 12:59 PM

No, I haven't even tried to compile it as I have neither GLUT nor GLEW libraries on my computer. You might want to add the path to the glew32 lib unter "Linker\General\Additional Libary Directories". Forgot to mention that one in my last post.



#23 Levent Cpp   Members   -  Reputation: 143

Like
0Likes
Like

Posted 03 June 2014 - 01:07 PM

i did it. didn't change :(



#24 Levent Cpp   Members   -  Reputation: 143

Like
0Likes
Like

Posted 03 June 2014 - 01:22 PM


in header add:
PFNGLMULTIDRAWELEMENTSPROC glMultiDrawElements; //name it whatever you want

and in cpp file: you need to initalize it

Its more than 10000 Lines biggrin.png where should i add it?


Edited by haykan648, 03 June 2014 - 01:23 PM.


#25 Jan2go   Members   -  Reputation: 959

Like
1Likes
Like

Posted 03 June 2014 - 01:24 PM

Another thing that I noticed when I opened the project file in Notepad++. It seems like you have copied GLEW (at least the glew.h) into Visual Studio installation directory. I strongly recommend you to not copy any file into these folders, they are meant for Microsoft's C++ implementation. Put your files into some other folder (C:\Programming Stuff\... or so) or, if we're talking about small libraries like GLEW even inside your project folder.

 

Are you sure that the paths you entered are correct? You might want to upload the updated project (after you moved GLEW out of the VS directory :)) again.



#26 Levent Cpp   Members   -  Reputation: 143

Like
0Likes
Like

Posted 03 June 2014 - 02:14 PM

I deleted all thing related to openGl from VC directory and put it in an external folder and i linked to them. Didnt change . :( what is the problem?

http://uploadboy.com/6bppjiz6kpx2.html



#27 Jan2go   Members   -  Reputation: 959

Like
2Likes
Like

Posted 03 June 2014 - 03:13 PM

1. You still have "glew32.lib" listed under "C/C++ > General > Additional Include Directories". This field is not meant for libraries or even files. In there you put, directories (not files!) where the compiler should look for files to #include in addition to the default ones (i.e. the place where Microsoft C++ implementation is and the folder of your own code).

2. Under "Linker > General > Additional Library Directories" you have also listed "glew32.lib". Again, this field is not for files. In there you put the directories (not files!) where the linker should look for the libraries (which you specify under "Linker > Input > Additional Dependencies").

 

So, if you remove the entry from "C/C++ > General > Additional Include Directories" and change the one in "Linker > General > Additional Library Directories" to the path to your glew32.lib (without filename) it should work.



#28 Levent Cpp   Members   -  Reputation: 143

Like
0Likes
Like

Posted 05 June 2014 - 09:16 AM

i changed my IDE to VS 2012 and did everething you said (same error) :

 

(VS 2012)

 

Additional Library Directories :

D:\OpenGl-Files\Files\lib;%(AdditionalLibraryDirectories)

Additional Dependencies :

kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;glew32.lib;%(AdditionalDependencies)


#29 Levent Cpp   Members   -  Reputation: 143

Like
0Likes
Like

Posted 05 June 2014 - 10:18 AM

i replaced glew X64 lib files with win32 glew lib files and i got an error : 0xc0000007b (something like this i'm not sure about 0s biggrin.png)  i searched and i gained it has something to do with X64 and X32 i don't know why. my system is x64 how can i fix the problem ? 

 

other errors biggrin.png :

'test.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file

the exact error(this error is in a message box after building program) :

the application was unable to start correctly (0xc0000007b).

Edited by haykan648, 05 June 2014 - 10:22 AM.


#30 BitMaster   Crossbones+   -  Reputation: 4442

Like
1Likes
Like

Posted 06 June 2014 - 04:42 AM

That suggests linking works fine now and you are just stuck with runtime errors. Have you verified that glewInit is called at the correct time and succeeds? Have you verified that the functionality you want to use is actually provided by your driver?

Also, you should learn enough about debugging an application to find the line where this error happens.

#31 Tribad   Members   -  Reputation: 887

Like
2Likes
Like

Posted 06 June 2014 - 05:03 AM

Linking with the gnu linker ld has some issues about the order the libraries are on the command line. MS linker do a recursive linking, means go along the named libraries as often as there are unresolved symbols.

 

ld does not.

If you habe -lgl -lglew then glew may add symbols that need imported from gl but because gl has already been used you get an unresolved external message.

 

To come around this behaviour of ld surround the list of libraries with --start-group --end-group parameter. Then ld goes along the libraries between these tags as long as needed to resolve all externals, stopping if no more symbols can be resolved.

 

If you call the gcc or g++ compiler driver to do the linking newer versions of gcc/g++, dont know the version number yet, accept -Wl,--start-group   -Wl,--end-group to build library groups.



#32 Levent Cpp   Members   -  Reputation: 143

Like
1Likes
Like

Posted 06 June 2014 - 10:04 AM

That suggests linking works fine now and you are just stuck with runtime errors. Have you verified that glewInit is called at the correct time and succeeds? Have you verified that the functionality you want to use is actually provided by your driver?

I tried glewInit And it worked Thank you! . Thank  you all.



#33 WiredCat   Members   -  Reputation: 367

Like
-2Likes
Like

Posted 06 June 2014 - 03:53 PM

glewinit initializes all extensions defined in glew.h 

 

 

Posted 03 June 2014 - 08:22 PM

WiredCat, on 03 Jun 2014 - 6:37 PM, said:

in header add:
PFNGLMULTIDRAWELEMENTSPROC glMultiDrawElements; //name it whatever you want

and in cpp file: you need to initalize it

Its more than 10000 Lines where should i add it?

 

you should add it after creating opengl context, (usually in glinit function)






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