Visual Studio 12 - cannot find basic functions - c++

I am a Java developer whose project needs one bit of C code (DLL) that I recompile every few years when I upgrade my machine. My new machine is AMD-64bit (Windows8) so the old 32-bit DLL will not run.
I installed MS Visual Studio 12. I copied the old project to the new machine. VS migrated it. I selected build and prayed that it would work. Of course, it did not.
I get these two errors:
1>IcmpSocketN.obj : error LNK2001: unresolved external symbol __imp__printf
1>IcmpSocketN.obj : error LNK2001: unresolved external symbol __imp___ftime64_s
1>C:\temp\new_March09\ATM\Release\AtiICMP.dll : fatal error LNK1120: 2 unresolved externals
These are two standard functions so I am assuming that VS installed them somewhere.
When I did the install I selected the C++ foundation libraries. When I look at the project properties I see that the only platform option is Win32. This is a 64-bit machine. I do not know if that matters or not.
The VS install on my old machine has a VC subdirectory with a bunch of libraries in it. The new install has no such directory.
Is there some .lib or .dll that I have to download independently of the VS install? Some environment variable change?
thanks

Related

Trying to use regsvr32 registered DLLs in VS 2019

So here's the issue:
I have an old software system written in C++ and built originally on Win Xp with VS 2005 SP1. Most of the solutions in this code-base are reliant on third-party DLLs that are registered using regsvr32.exe. Without this step VS 2005 throws out Linker errors. After registration everything works like a charm.
I've been able to successfully rebuild the project using Win 10 and VS 2005 and now I'm trying to do the same with newer version of VS, namely VS 2019. For a single test solution I was able to resolve compilation errors, but it seems that VS 2019 Linker cannot find DLLs that should have been registered with regsvr32, since I'm getting the same Linker errors that I have have been getting with VS 2005 prior to registering DLLs.
I'm most certainly sure that this is due to VS 2019 "not seeing" DLLs that were registered with regsvr32. Thus the question: does anybody have any idea how to make VS 2019 discover those DLLs?
DLLs and target for compiler are 32bit. I've been using SysWOW64\regsvr for registering 32 bit DLLs. The folder with DLLs is in $PATH. Also the folder with DLLs is set in Project -> Project Properties -> VC++ Directories -> Library Directories setting of VS 2019
Edit:
Linker Errors in both cases (before using regsvr32 with VS 2005 and with VS 2019) are of form:
...
1>RecordSet.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall IDatabase::~IDatabase(void)" (__imp_??1IDatabase##QAE#XZ) referenced in function "public: void * __thiscall IDatabase::`scalar deleting destructor'(unsigned int)" (??_GIDatabase##QAEPAXI#Z)
...
Followed by fatal error LNK1120: 17 unresolved externals
I'd be glad to get any pointers.

VS 2017 Community gets linker errors but Professional doesn't

We're facing a strange issue and I've run out of troubleshooting ideas. The issue is that on some machines, which are running Visual Studio 2017 Community, we get reports that our project (which is CMake based) gets linker errors like this:
17>------ Build started: Project: ndt, Configuration: RelWithDebInfo x64 ------
17> Creating Library E:/NDT_3_0/19_Sept18/qualnet/RelWithDebInfo/exata_so.lib and object E:/NDT_3_0/19_Sept18/qualnet/RelWithDebInfo/exata_so.exp
17>ndt-main-windows-x64-vc14.obj : error LNK2019: unresolved external symbol edKJPOs664VT referenced in function "void __cdecl CheckLibraryLicenses(struct NodeInput*,...)
17>ndt-main-windows-x64-vc14.obj : error LNK2019: unresolved external symbol zzPIPSGJWa referenced in function main
...
17>E:\NDT_3_0\19_sep18\qualnet\bin\exata_so.exe : fatal error LNK1120: 17 unresolved externals
(Apologies if there are typos: for some reason they sent us a screenshot of the text instead of just a copy-and-paste of the text, so I'm transcribing. However, the parts I'm leaving out contain no mention of errors trying to open lmgr.lib which defines these symbols.)
The strange thing is, we can't reproduce these errors here when we do a fresh clone of the same Bitbucket repository they're using and follow the same build instructions. About the only difference I can tell is that our machines are running Visual Studio 2017 Professional. (Though I'm certainly not sure if this is actually the cause of the behavior differences.)
So far, what we've checked:
The library that contains the unresolved external symbols passes sha1sum checks so their Git client isn't corrupting the library binary file lmgr.lib - and same for the ndt-main-windows-x64-vc14.obj file.
The generated ndt.vcxproj project contains (the correct path to) lmgr.lib in the "Linker -> Input -> Additional Dependencies" property, as expected.
The lmgr.lib file does define the mentioned symbols (verified by Cygwin binutils nm).
On their machines, they get essentially the same linker errors whether using the Visual Studio 15 2017 Win64 generator and building from the IDE, or using the NMake Makefiles generator and building from a command prompt. Both configurations work fine on our machines.
I was wondering if somebody out there might have any ideas on why some machines might be failing to find the symbols in lmgr.lib whereas our machines have no problems completing the link stage.
(Possibly relevant: lmgr.lib contains the FlexNet Publisher licensing libraries where the symbols in both lmgr.lib and ndt-main-windows-x64-vc14.obj have been obfuscated by Flexera's lmstrip tool.)
It turned out that when we asked them to upgrade their Visual Studio 2017 Community installation to the latest service pack release, then after that the linker errors disappeared.

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 !

unresolved external symbol _forceCRTManifestCUR

When I am trying to build one of my C++ solution for x64 architecture. I am getting alot of these errors:
Error 34 error LNK2001: unresolved external symbol _forceCRTManifestCUR
Project was working fine before but I had to reinstall windows and so
VS since than it is having this problem.
It builds all fine when i build it for x32
My Operating System is Windows XP - X32 (Visual Studio - 2008) can this be the reason? I
hope it is possible to build a solution for x64 architecture while
on a x32 system?
Please guide me how can i resolve this issue.
Thankyou.

unable to run OpenCV in Microsoft Visual C++ 2010 on Windows 7 machine

I have followed the intrunctions here to the core.
And they run perfect on Windows 7 32 bit machine. But I use the same instructions with Windows 7 64 bit machine. I get the following error.
error LNK2019: unresolved external symbol _cvDestroyAllWindows referenced in function "void * __cdecl trial1(void *)" (?trial1##YAPAXPAX#Z)
and similarly for other openCV methods.
I have made changes in my Configuration Manager and added x64 to the Solutions Platform but still getting the errors.
You need to link the *.lib files in the project properties. They is a lib file for every header file included in the code. i.e. opencv2/core has lib opencv_core.lib