Can't get GLEW to work with VS2012 - opengl

I have been trying to figure this out for hours but with no luck:
error LNK2019: unresolved external symbol _imp_glBegin#4 referenced in function _main
error LNK2019: unresolved external symbol _imp_glEnd#4 referenced in function _main
error LNK2019: unresolved external symbol _imp_glFlush#4 referenced in function _main
error LNK1120: 3 unresolved externals
Pretty standard errors for linking, but I tried everything that came to my mind without luck unfortunately.
My setup is as follows:
SFML 2.0 as the window manager
GLEW 1.90 as the OpenGL extension manager
SFML is working, so it's correctly linked etc...
I have included GLEW include and library directories, I have also added glew32d.lib to the Additional Dependencies + added the glew32d.dll to the Debug folder (where the .exe resides)
I also built GLEW from source, so it should work :S

GLEW stands for "OpenGL Extension Wrangler Library". It doesn't define core OpenGL functions like glBegin() and glEnd(). Are you also including your opengl32.lib, glu32.lib, and glut32.lib libs?

Related

Including Lua in VS2015 C++ Project

I would like to integrate Lua into my current C++ application I build with VisualStudio 2015 (x64 mode).
I grabbed a simple Lua wrapper from here, and the Lua binaries for windows x64 from here (the lua-5.1.5_Win32_dll14_lib.zip one).
Next, I added the include and library path to the project preferences. Works so far in the IDE. However, when I try to compile the code it throws 24 errors (like these first two):
1>LuaScript.obj : error LNK2019: unresolved external symbol "lua_close" referenced in function ""public: __cdecl LuaScript::~LuaScript(void)" (??1LuaScript##QEAA#XZ)".
1>LuaScript.obj : error LNK2019: unresolved external symbol "lua_gettop" referenced in function ""public: void __cdecl LuaScript::clean(void)" (?clean#LuaScript##QEAAXXZ)".
which tells me next to nothing. Seems that the linker is unable to find the library but the includes are working and the path to library is set, too. Any suggestions what I might have missed or should look into? Any hint would be appreciated!

SOIL library - unable to link

While building my project, I get the same issue, solved in this links:
SOIL not linking correctly,
SOIL set-up in Visual Studio 2010
I tried every suggested solution:
build the VC8 and VC9 libraries to get the SOIL.lib (I'm using VS 2013)
linked the libraries (Linker - Additional Dependencies)
renamed the libSoil.a to SOIL.lib
but still having the same errors:
1>libSOIL.a(stb_image_aug.o) : error LNK2019: unresolved external symbol __alloca referenced in function _stbi_zlib_decode_noheader_buffer
1>libSOIL.a(image_helper.o) : error LNK2019: unresolved external symbol _sqrtf referenced in function _RGBE_to_RGBdivA2
Any ideas , other solutions?

Windows 8: Desperate on how to link dsound

I have a project in which I need to link some DirectX libraries in windows 8. I cannot figure out where to find these symbols, if it's because of a mismatch between versions/runtimes or whatever somewhere or what the hell could be happening.
So I link with these libraries, under windows 8.1 (with cmake):
set(MY_LIBS
general dsound
general d3d9
general dxerr
general strmiids
general comctl32
general winmm
general pdh
general ComDlg32
general Gdi32
general User32
general Ole32
general oleaut32
general Msimg32
general opengl32
general glu32
general PowrProf
general strmbase)
As you can see I also include strmbase, which is the sample compiled for base classes from the windows sdk, that I compiled myself. But I still have these unresolved references:
error LNK2019: unresolved external symbol _DirectSoundCaptureEnumerateW#8 referenced in...
error LNK2019: unresolved external symbol _GetDeviceID#8 referenced in...
error LNK2001: unresolved external symbol _GetDeviceID#8
error LNK2019: unresolved external symbol _DirectSoundEnumerateW#8 referenced in...
LNK2019: unresolved external symbol _DirectSoundCaptureCreate8#12 referenced in function...
error LNK2019: unresolved external symbol _DirectSoundCreate#12 referenced in function...
Does anyone have any idea where to find these symbols and/or what to do to get it compiling.
The problem was that there was a precompiled library trying to find these symbols in a 64-bit library. But the precompiled library was expecting 32-bit symbols because the name mangling is different. The problem was gone when I linked against 32-bit libraries, even if my system is 64 bits.

Installing GLFW 3.0 not working Visual Studio

I'm trying to create a GLFW project, but I'm getting LNK2019 errors with the basic setup.
I've downloaded the latest binary (glfw-3.0.bin.WIN32.zip) to a folder.
I've created a new, empty console project.
Within VC++ Directories, I've added the following line to include directories:
C:\C++Libraries\glfw-3.0.bin.WIN32\include
I've added the following line to the Library Directories:
C:\C++Libraries\glfw-3.0.bin.WIN32\lib-msvc110
I've linked the following libraries:
opengl32.lib, glfw3.lib, glfw3dll.lib
From the latest tutorial, I paste into my project (no visible syntax errors) to test, but I get four LNK2019 errors after trying to run it.
Here are the errors:
Error 2 error LNK2019: unresolved external symbol __imp__joyGetPosEx#8
referenced in function __glfwPlatformGetJoystickAxes
c:\Users\Spicy Weenie\documents\visual studio 2012\
Projects\Beta\Beta\glfw3.lib(win32_joystick.obj)
Error 3 error LNK2019: unresolved external symbol __imp__joyGetDevCapsW#12
referenced in function __glfwPlatformGetJoystickAxes
c:\Users\Spicy Weenie\documents\visual studio
2012\Projects\Beta\Beta\glfw3.lib(win32_joystick.obj)
Error 4 error LNK2019: unresolved external symbol __imp__joyGetPos#8
referenced in function __glfwPlatformJoystickPresent
c:\Users\Spicy Weenie\documents\visual studio
2012\Projects\Beta\Beta\glfw3.lib(win32_joystick.obj)
Error 1 error LNK2019: unresolved external symbol __imp__timeGetTime#0
referenced in function __glfwInitTimer c:\Users\Spicy Weenie\documents\visual
studio 2012\Projects\Beta\Beta\glfw3.lib(win32_time.obj)
You need to link in at least winmm.lib for timeGetTime. The joystick code is probably in there to.

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.