Linker error ( VS 2005 vs VS 2012 ) - c++

I am trying to build libxml2 library with VS 2012 compiling and linking against DDK 7 headers and libraries. With VS 2005 it builds fine but with VS 2012, I am getting a linker error. On close inspection of symbols generated -
On VS 2005,
Found __imp___vsnprintf
Referenced in error.obj
Referenced in xmlreader.obj
Referenced in xmlwriter.obj
Referenced in xmlstring.obj
Loaded msvcrt.lib(msvcrt.dll)
On VS 2012,
error.obj : error LNK2019: unresolved external symbol __imp__vsnprintf
referencedin function ___xmlRaiseError
xmlreader.obj : error LNK2001: unresolved external symbol __imp__vsnprintf
xmlwriter.obj : error LNK2001: unresolved external symbol __imp__vsnprintf
xmlstring.obj : error LNK2001: unresolved external symbol __imp__vsnprintf
__imp__vsnprintf, __imp___vsnprintf on VS 2012 and VS 2005 respectively for the same function ( Notice the extra _ mark before vsnprintf in VS 2005). I looked at the compiler and linker options for the VS 2005 and VS 2012 in the build log. Both are the same. With the showIncludes option passed to the compiler, I see the exactly same set of headers used for the source files on both VS 2005 and VS 2012.
Why is yet the symbol generation in VS 2012 being different ? How to resolve the issue with out compiling and linking against default headers and libs ?
Thanks.

Do not use DDK for building user-mode components. DDK stands for Driver Development Kit. Using it for user mode is undefined behavior. Use SDK instead.

Related

Unresolved external symbol error while trying to run PARDISO on windows 10

I downloaded the PARDISO libraries from https://www.pardiso-project.org and obtained the license too. As per the user manual, I have installed Microsoft Visual Studio 2019 as well as Intel Parallel XE 2020 for the cl and Intel compilers. I have placed the .dll file, the .lib file and the .exp file along with the license (.lic file) in c:\users\hp. Microsoft Visual Studio has been installed and the source and repository folders are placed in c:\users\hp\Source.
I tried to run the sample code on Visual Studio : https://pardiso-project.org/manual/pardiso_unsym.f (equivalent C++ code is https://pardiso-project.org/manual/pardiso_unsym.cpp)
I got the following errors:
For the C++ code:
unresolved external symbol pardisoinit referenced in function main Trial4 C:\Users\hp\source\repos\Trial4\Trial4\tryout1.obj 1
For the Fortran code:
error LNK2019: unresolved external symbol _PARDISOINIT referenced in function _MAIN__ Tryout2.obj
I know that all this has something to do with the libraries being placed in the correct place but I am unable to figure it out correctly. Could someone tell me how I can solve this problem? I am using Microsoft Visual Studio 2019.

LNK2019 unresolved external symbol _hypot referenced in function _gsl_matrix_complex_long_double_div_elements

I am trying to build a C++ Visual Studio 2005 solution in Visual Studio 2010.
I fixed some of upgrade issues so far when building the solution in the Visual Studio 2010.
However the last thing I do not know how to fix is the below link error message:
LNK2019 unresolved external symbol _hypot referenced in function _gsl_matrix_complex_long_double_div_elements in libgsl_d.lib.
Does anyone know of this issue?
TIA

Qt Creator: unresolved external symbol __imp__EncodePointer

I'm trying to compile an empty "qt widgets application" project created with Qt Creator.
It gives me various linking errors like
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol __imp__EncodePointer#4 referenced in function _pre_c_init
MSVCRTD.lib(atonexit.obj) : error LNK2001: unresolved external symbol __imp__EncodePointer#4
and so on.
Building qt examples gives the same error.
I have Visual Studio 2010 and Windows SDK installed, the right compiler seems to be chosen.
UPD: I have switched to miniGW compiler and it works now. Not sure if that solution is suitable for everybody.

Visual Studio 2010 : error LNK2001: unresolved external symbol : sapi.h and Microsoft Speech SDK for KINECT

I'm encountering a strange bug in Visual Studio 2010...
I work with the Kinect for Windows SDK v1.8 on VS 2010 Ultimate, for a speech recognizer program using the MS Kinect.
Like it's explained in the sample SpeechBasics (available on Kinect Developer Toolkit Browser), I added the specifics VC++ include and library paths into my project properties, before listing the default system include and library directories.
But When I buid the solution, I get the following errors :
CKinect_Squeletton.obj: error LNK2001: unresolved external symbol _SPDFID_WaveFormatEx
CKinect_Squeletton.obj: error LNK2001: unresolved external symbol _CLSID_SpStream
CKinect_Squeletton.obj: error LNK2001: unresolved external symbol _CLSID_SpInprocRecognizer
CKinect_Squeletton.obj: error LNK2001: unresolved external symbol _CLSID_SpObjectTokenCategory
build failed.
I had checked all my include files, all my project properties. I did a lot of research, and tested many possibilities of response, but I hadn't found response for my problem...
I have tried cleaning the solution, build with a x64 target architecture, but that doesn't always work.
Why have I this problem ?
Like suggested in the comment, I've checked the link on social MSDN
I've resolved some errors but not all in using __uuidof(SpStream) instead of CLSID_SpStream , and __uuidof(SpInprocRecognizer) instead of CLSID_SpInprocRecognizer .
But i don't found CLSID_SpObjectTokenCategory in my code, I have only
ISpObjectToken *pEngineToken = NULL;
hr = SpFindBestToken(SPCAT_RECOGNIZERS,L"Language=40C;Kinect=True",NULL,&pEngineToken);
I can't replace it with __uuidof(SpObjectTokenCategory) .
Also, I always don't know how to resolve the error
CKinect_Squeletton.obj: error LNK2001: unresolved external symbol _SPDFID_WaveFormatEx
I've added sapi.lib in Project + Properties, Linker, Input, and I also try with #pragma comment(lib, "sapi.lib")
I have resolved my problem !
I work on Windows 7 64bit, and I had installed MS Speech Platform SDK 11 x64.
But to build with a x86 target architecture , I had to install and use MS Speech Platform SDK 11 x86, and specify in my project properties the path for the x86 sapi lib !
The compiler gave me errors when I've tried to build with a x64 target architecture, because others specific libraries that I have included in the project are for a x86 architecture...
Sorry and maybe this solution will help someone one day !

Setting up SDL in Visual Studio with Errors

I have been having this issue for a very long time, I have not even had no luck and it is becoming very frustrating. I am really itching to create games in C++ with OpenGL/SDL. I am using Microsoft Visual Studio Ultimate 2012. My Operating System is a 64-bit Windows 7.
I had no troubles setting up OpenGL with Visual Studio, but SDL is the main problem. I follow lazy foo tutorials, I looked at YouTube videos, god damn it is irritating. The error I am getting when debugging SDL in Visual Studio is:
1>SDLMain.obj : error LNK2019: unresolved external symbol _SDL_Init
referenced in function _SDL_main 1>SDLMain.obj : error LNK2019:
unresolved external symbol _SDL_Quit referenced in function _SDL_main
1>MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol
WinMain#16 referenced in function __tmainCRTStartup
I do not know what you mean by building the libraries by myself, but I did link the SDL Library. I switched from x64 to x86 and when I debugged my code again I got this message:
The application was unable to start correctly (0xc000007b). Click OK to close the application.
So your saying if I downloaded an earlier version of Visual studio, I can run SDL without a problem?