Installing GLFW 3.0 not working Visual Studio - c++

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.

Related

unresolved external symbol inflateEnd (and others) while using boost Zlib

I'm in the process of converting 32bit project to x64. In most cases it just means appending 64 to library paths (and eventually building those libraries for x64). Now I assume all libraries are already ready and the code is also x64 compatible. But I keep getting errors for boost zlib library, like these:
error LNK2019: unresolved external symbol inflateEnd
error LNK2019: unresolved external symbol inflate
error LNK2019: unresolved external symbol inflateInit_
error LNK2019: unresolved external symbol deflateEnd
error LNK2019: unresolved external symbol deflate
error LNK2001: unresolved external symbol "int const boost::iostreams::zlib::default_compression"
error LNK2001: unresolved external symbol "int const boost::iostreams::zlib::deflated"
error LNK2001: unresolved external symbol "int const boost::iostreams::zlib::default_strategy"
I enabled verbose mode for linker (in MS Visual Studio you do this by adding /VERBOSE:LIB to additional linker options). Thanks to that, I can see this output line:
Searching .\..\..\libs\boost145\stage\lib64\libboost_zlib-vc100-mt-gd-1_45.lib
That would imply that the library was found in the boost145\stage\lib64. So what should I be looking for now?
One strange thing is that file that defines the first group of missing symbols (those that are not within boost) has header files within the project, zlib.h and zconf.h. Maybe this is some hint? The zlib.h defines external symbols as:
ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
Obvious question is: where the hell is lib file for this header file?
I had the same issue, to resolve the errors I download the source from zlib and built the x64 dlls/libs locally. There were a couple issues with solution file downloaded, fixes are described below.
Zlib 1.2.8 source code: http://zlib.net/zlib128.zip
Solution File for VS2012 is located at: zlib-1.2.8\contrib\vstudio\vc11\zlibvc.sln
Fixes:
Change:
<Command>cd ..\..\..\contrib\masmx64
bld_ml64.bat</Command>
to:
<Command>cd ..\..\contrib\masmx64
bld_ml64.bat</Command>
In zlibvc project properties -> Linker -> Advanced -> Image Has Safe Exception Handlers -> set to No (/SAFESEH:NO). Info about SAFESEH: Compiling libffi with VS2012 fails with fatal error LNK1281: Unable to generate SAFESEH image

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?

CUDA 6.5: error MSB3191 Unable to create directory and LNK2001 Unresolved External symbol

I am running CUDA 6.5 on Visual Studio 2013 x64.
I have a VC++ static library project named MyLib which is linked with MyClient x64 console executable project. I added CUDA 6.5 build customization to both the projects. In addition, I goto Configuration Properties -> CUDA C/C++ and have set “Target Machine Platform” as 64-bit for these two projects as I want to compile them for x64 platform
I added MyCUDACode.cpp and MyCUDACode.h files to MyLib project and marked their item type as CUDA C/C++ instead oc C/C++ compiler. MyCUDACode.cpp has number of functions which call CUDA API functions. Also, MyCUDACode.h references the cuda.h and cuda_runtime.h files.
MyClient is linked with MyLib. I now get two compilation errors:
First error in compiling MyLib which says a Unable to create directory
Second, I get unresolved external symbol errors while linking
MyClient with MyLib. Here is the log output:
------ Build started: Project: MyLib, Configuration: Release x64 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 6.5.targets(412,9): error MSB3191: Unable to create directory "x64\Release\D:\github\src\helpers\". The given path's format is not supported.
2>------ Build started: Project: MyClient, Configuration: Release x64 ------
2>MyLib.lib(MyCUDACode.obj) : error LNK2001: unresolved external symbol cudaGetDeviceCount
2>MyLib.lib(MyCUDACode.obj) : error LNK2001: unresolved external symbol cudaDeviceCanAccessPeer
2>MyLib.lib(MyCUDACode.obj) : error LNK2001: unresolved external symbol cudaGetDeviceProperties
2>MyLib.lib(MyCUDACode.obj) : error LNK2001: unresolved external symbol cudaSetDevice
2>MyLib.lib(MyCUDACode.obj) : error LNK2001: unresolved external symbol cudaDeviceDisablePeerAccess
2>MyLib.lib(MyCUDACode.obj) : error LNK2001: unresolved external symbol cudaDeviceReset
2>MyLib.lib(MyCUDACode.obj) : error LNK2001: unresolved external symbol cudaDeviceEnablePeerAccess
2>C:...\visual studio 2013\Projects\Prj\x64\Release\MyClient.exe : fatal error LNK1120: 7 unresolved externals
I have tried both release and debug modes but I get same error.
I am just reproducing the steps to resolve the errors:
To resolve the error(temporary workaround): MSB3191: Unable to create directory The given path's format is not supported., simply copy Cuda cu and cuh files to Visual studio project folder.
[UPDATE]: I recently found a better solution for the issue MSB3191: Unable to create directory The given path's format is not supported.. This fix works without need to move around the cu files to the VS project folder. For this, open the file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 6.5.targets", and move to the offending line(412 in this case). This line contains following xml section:
<MakeDir
Condition="'%(CudaCompile.ExcludedFromBuild)' != 'true'"
Directories="%(CudaCompile.DepsOutputDir)" />
As you can see, this is a sort of directive which tells the build system to make a folder for the cuda files being compiled. The property used for folder name is CudaCompile.DepsOutputDir. Now open the file: "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 6.5.props". This props file defines values of the properties used in targets file. Now search for word DepsOutputDirin this props file. There are only XML section which defines and refers to this keyword is:
<!-- Miscellaneous -->
<DepsOutputFile>%(Filename)%(Extension).deps</DepsOutputFile>
<DepsOutputDir>$(IntDir)%(RelativeDir)</DepsOutputDir>
<DepsOutputPath>%(DepsOutputDir)%(DepsOutputFile)</DepsOutputPath>
Now, to finally fix the MSB3191 issue, simply remove the variable %(RelativeDir) from above xml section and save the props file (this would require administrative privileges)
To resolve the error: LNK2001: unresolved external symbol, follow the Settings for Linker section in this post

Upgrade C++ VS 2005 Project to VS 2010 Causes LNK2019 error

I'm attempting to upgrade a project written in C++ in VS 2005 to VS 2010. After I run the upgrade wizard, I try and build the project and I get a bunch of LNK2019 errors.
For further clarification, this projects builds a DLL which is used by our Product Lifecycle Management system named Teamcenter.
At this point, I'm kind of stumped. The project compiles in VS 2005 in Debug without any issues.
Any ideas?
Here is a snippet of the error:
Error 16 error LNK2019: unresolved external symbol __imp__EMH_store_error_s1 referenced in function "int __cdecl AFCC_create_ai(struct EPM_action_message_s)" (?AFCC_create_ai##YAHUEPM_action_message_s###Z) C:\Users\kevmoo\Documents\Visual Studio 2010\Projects\AFCC\AFCC\AFCC\AFCC_action_handlers.obj AFCC
Error 17 error LNK2019: unresolved external symbol __imp__EPM_add_attachments referenced in function "int __cdecl AFCC_create_ai(struct EPM_action_message_s)" (?AFCC_create_ai##YAHUEPM_action_message_s###Z) C:\Users\kevmoo\Documents\Visual Studio 2010\Projects\AFCC\AFCC\AFCC\AFCC_action_handlers.obj AFCC

Linker errors while migrating from x32 to x64

I have recently migrated a project from x32 to x64 in VS professional 2008 and I'm getting this weird linker errors:
error LNK2001: unresolved external symbol __imp_PostMessageW
error LNK2001: unresolved external symbol __imp_FlushFileBuffers
error LNK2001: unresolved external symbol __imp_WriteFile
error LNK2001: unresolved external symbol __imp_WaitForSingleObject
error LNK2001: unresolved external symbol __imp_SetFilePointer
error LNK2001: unresolved external symbol __imp_EnterCriticalSection
...
And more of this nature.
I am including shlwapi.lib in the linker.
Running on Windows 7 x64.
Additional Dependencies:
The solution for my problem was setting Linker > General > Additional Library Directories with "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\x64" instead of "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib".
Ensure that the x64 configuration is selected. Right-click your project in the Solution Explorer window, Properties, Linker, Input. Click on the Additional Dependencies box and click the button that appears.
This is what it should look like if the project is configured correctly. Note how the "Inherit" checkbox is ticked and how the inherited values list the standard SDK libraries. Like kernel32.lib, the link library that has the definition for __imp_FlushFileBuffers, etc. If it doesn't look like this in your project then you'll get these linker errors.