Unresolved external symbols linking to glew32s.lib - c++

So this isn't the first time I have run into this problem, but the solutions that worked in the past don't seem to be working. I am currently receiving the following errors:
Error LNK1120 6 unresolved externals
Error LNK2019 unresolved external symbol __imp__glGetString#4 referenced in function _glewContextInit#0
Error LNK2019 unresolved external symbol __imp__wglGetCurrentDC#0 referenced in function _wglewGetExtension#4
Error LNK2019 unresolved external symbol __imp__wglGetProcAddress#4 referenced in function __glewInit_GL_3DFX_tbuffer
Error LNK2019 unresolved external symbol __imp__glClear#4 referenced in function "public: void __thiscall vortex::graphics::Window::clear(void)const " (?clear#Window#graphics#vortex##QBEXXZ)
Error LNK2019 unresolved external symbol __imp__glEnable#4 referenced in function "private: bool __thiscall vortex::graphics::Window::init(void)" (?init#Window#graphics#vortex##AAE_NXZ)
Error LNK2019 unresolved external symbol __imp__glViewport#16 referenced in function "void __cdecl vortex::graphics::windowResize(struct GLFWwindow *,int,int)" (?windowResize#graphics#vortex##YAXPAUGLFWwindow##HH#Z)
to give you a rundown of what I have tried, I have checked and rechecked the linking paths to the libraries, I have put the GLEW_STATIC preprocessor definition in the necessary section, I have redownloaded the libraries multiple times to make sure I was linking a Win32 library to the Win32 application, and I have no idea what to do now. It was working fine for awhile, and the above solutions would always fix this sort of error, but not this time. The sooner I can get a response the better, as this is a project that I wanna get more work done on soon. Thank you for any help you can give me.

Add OpenGL32.lib and glu32.lib to your linker inputs.

Add opengl32.lib to your linker inputs, and
add GLEW_STATIC to your Properties->C/C++->Preprocessor->Preprocessor Definitions

I had a very similar problem myself, and the solution for me was adding the glew32.dll to the folder, as well as adding #pragma comment(lib, "glew32.lib") and linking to it. The glew32.dll will refer to glew32.lib, so if you dont have it, it will give off similar linking errors.

Related

LNK2019 when trying to use FreeType 2.10.1?

I have been trying to complete the first tutorial on the FreeType website. I am using the provided code on the website and I have added the libraries and included the proper include files but I receive 7 LNK2019 errors:
Error LNK2019 unresolved external symbol FT_Set_Transform referenced in function main \main.obj 1
Error LNK2019 unresolved external symbol FT_Set_Char_Size referenced in function main \main.obj 1
Error LNK2019 unresolved external symbol FT_New_Face referenced in function main \main.obj 1
Error LNK2019 unresolved external symbol FT_Load_Char referenced in function main \main.obj 1
Error LNK2019 unresolved external symbol FT_Init_FreeType referenced in function main \main.obj 1
Error LNK2019 unresolved external symbol FT_Done_FreeType referenced in function main \main.obj 1
Error LNK2019 unresolved external symbol FT_Done_Face referenced in function main \main.obj 1
I found this stack over flow thread and tried what the comments suggested but that made more errors pop up.
I tried this tutorial on how to set it up but I still receive the same 7 errors. And the guy in the comments section had the same problem as me but no answers there.
Build the .lib file on your computer, don't use another one and read index.html in the VS project .sln directory.
Be sure that the configuration when building the .lib is similar to the configuration of the project you want to add the file to...
Make sure to add it to additional dependencies (Linker -> Input) NOT (Linker->General)
Add the full directory (also with the freetype.lib name) AFTER %(AdditionalDependencies) macro

Live555 and Visual Studio 2010

I am trying to compile Live555 test programs in Visual Studio 2010, but I wasn't able to do so.
I compiled the libraries without any problems
BasicUsageEnvironment.lib
groupsock.lib
liveMedia.lib
UsageEnvironment.lib
but when it comes to the test programs, I just couldn't get anywhere. Here is the compiler message when I compile files in the mediaServer.
Has anyone encountered this problem before?
error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3#YAXPAX#Z)
error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2#YAPAXI#Z)
error LNK2001: unresolved external symbol ___security_cookie
error LNK2001: unresolved external symbol ___CxxFrameHandler3
error LNK2001: unresolved external symbol #__security_check_cookie#4
error LNK2001: unresolved external symbol __RTC_CheckEsp
error LNK2001: unresolved external symbol __RTC_Shutdown
error LNK2001: unresolved external symbol __RTC_Shutdown
error LNK2001: unresolved external symbol __RTC_InitBase
error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info##6B#)
error LNK2001: unresolved external symbol "public: virtual bool __thiscall Medium::isSource(void)const " (?isSource#Medium##UBE_NXZ)
<more errors>
Complete dump here: http://pastebin.com/4bVQAcdp
Update
I failed to build the project earlier because I unchecked the "Precompiled header" option when creating projects for all the libraries. When linking the libraries to my mediaServer project, VS was unable to resolve all the functions.
I was able to make it work by rebuilding them with "Precompiled header" option checked, and add #include "stdafx.h" to each and every *.cpp file.
Afterthought: I have a feeling that I only need to turn on "Precompiled header" option for the mediaServer project. Let me know if you have tried and succeeded. ;-)
Update 2
Nope. I had to turn on Precompiled Header for each and every one of the static library projects. And add #include "stdafx.h" to ~200 *.cpp files. Yep.
Update
I took a look at your full dump:
1>UsageEnvironment.lib(HashTable.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3#YAXPAX#Z)
Based on this first error, what ever source you compiled for your UsageEnviroment Lib, has a reference to a delete operator function. My guess is that either you don't have the correct source code you altered it. Can paste the UsageEnvironment.hh file contents?
I happened to be working on building this right now, I just got it working this morning, and per your request I compiled the Test Program "mediaServer". We are operating on a few assumptions here, we are assuming that you built the static libraries correctly.
Assuming the static libraries are correct this is the solution your looking for:
Include:
c:\Live555\BasicUsageEnvironment\include
c:\Live555\liveMedia\include
c:\Live555\UsageEnvironment\include;
c:\Live555\groupsock\include
$(IncludePath)
Lib Paths:
"*Insert path to your lib files here*";
$(LibraryPath)
Linker input:
Ws2_32.lib
groupsock.lib
BasicUsageEnvironment.lib
liveMedia.lib
UsageEnvironment.lib
libBasicUsageEnvironment.lib
libgroupsock.lib
Your solution folder should look like this:
Make sure the files in Bold are there.
your Source Folder should have the following files:
mediaServer:
**DynamicRTSPServer.cpp**
**DynamicRTSPServer.hh**
**live555MediaServer.cpp**
mediaServer.vcxproj
mediaServer.vcxproj.filters
ReadMe.txt
**rtcp_from_spec.c**
**rtcp_from_spec.h**
stdafx.cpp
stdafx.h
targetver.h
**version.hh**
Based on your errors its looks like you have incorrect source files included in your project, those unresolved reference don't appear anywhere in the live555 project tar file.
http://live555.com/liveMedia/public/live555-latest.tar.gz
If this solution doesn't work, please provide screen shots of your project settings for the following tabs:
include directories
Linker Input
File listing for your project folder.
Let me know if this helps, if this doesn't work we will have to look into how your static libraries were built. We need to see where in your code, those external references are being made, and what ever is making those references need to be excluded as they don't appear in the live555 archive referenced in the link below.

unresolved external symbol _gluLookAt#72 referenced in function

I'm making a program using the glu library but when i compile i got this error:
1>opengl_3.obj : error LNK2019: unresolved external symbol _gluLookAt#72 referenced in function "public: void __thiscall OpenGLContext::setupScene(void)" (?setupScene#OpenGLContext##QAEXXZ)
I included GL/glu.h and checked if the lib and dll were present. (they are by default)
I'm using visual studio 2012.
Any idea where this error is coming from?
You are not linking to glu. Add glu to the libraries against which your program should be linked. A more detailed description can be found here.

error LNK2019: unresolved external symbol SHInitExtraControls referenced?

How can i resolve this error:
Error 1 error LNK2019: unresolved external symbol SHInitExtraControls referenced in function "public: virtual int __cdecl CTestApp::InitInstance(void)" (?InitInstance#CTestApp##UAAHXZ) Test.obj
thanks
You need to link against aygshell.lib. Note that the MSDN page for SHInitExtraControls() says that aygshell.lib is the required library to use it.
A LNK2019 usually means that you forgot to provide a definition of something. In this case, the definition of SHInitExtraControls() is located in aygshell.lib. Without it, the linker will complain when you attempt to use SHInitExtraControls().
To link against aygshell.lib in Visual Studio, go to Project --> Properties --> Linker --> Input --> Additional Dependencies then type aygshell.lib in the box.

Trying to compile program that uses zlib. Link unresolved error

While trying to compile program, that uses zlib, i got following errors:
Error 1 error LNK2019: unresolved
external symbol _compress referenced
in function "void __cdecl
save_image_in_pakfile(class
std::basic_ofstream > &,struct
_IplImage *)" (?save_image_in_pakfile##YAXAAV?$basic_ofstream#DU?$char_traits#D#std###std##PAU_IplImage###Z) buffer_management.obj
Error 2 error LNK2001: unresolved
external symbol
_compress fern_based_point_classifier.obj
And two more same errors but related to uncompress function.
I use the vs2008 C++, and at the project properties I added in
C/C++ : Additional include directories the path to header files of zlib.
And at linker properties I added at additional dependencies:
zlibwapi.lib and zlibstat.lib files.
How to resolv the problem?
If I made some mistakes please show me them..