VS2019+WDK10, missing Spectre-mitigated MSVC library for 16.11, why? - visual-studio-2019

Some weird stuff here. I'm trying to build a KMDF sample driver with VS2019 16.11.5 and WDK 10.0.19041.685 (also called version 2004 Dec 2020 update).
First, I got compilation error saying that I need to download Spectre-mitigated MSVC library.
Well, I try it, but got a new problem. The VS2019(16.11.5) installer does not show MSVC Spectre-mitigated MSVC library version for exact 16.11. Looks like the latest one it provides is 16.10 (🙁).
Download the 16.10 one and resume trying, still compilation error.
I peek into my D:\VSIDE\VS2019\VC\Tools\MSVC folder, and see two versions of MSVC libs listed, 14.29.30133 and 14.29.30037 . The later is the one with spectre libs(so it's 600MB+ larger).
However, the KMDF build tool insists to find MSVC libs in the newer 14.29.30133 folder, so Spectre-mitigated libs still CANNOT be found.
I know I can manually copy the required files from 14.29.30037 to 14.29.30133 to make things go on. BUT is it the decent way to do so, or is it a Microsoft toolset bug?
I'd like to ask how other kernel driver developers solve this issue. Thank you.

Well, several days later, I find out two workarounds for this issue.
First, as Hans Passant stated, disable the Spectre lib in .vcxproj. This can be configured from UI.
Second, explicitly select a MSVC library version for current project. This can also be configured in project settings UI.
==== 2022.02.11 UPDATE ====
Finally got it,the Spectre-lib with version number 14.29.30133 is called "(Latest)", so it is listed above the oldest version, and this defeats the novice. Use this and problem solved.
Sure, it is stupid enough to mark it as merely "(Lastest)". He should have named it MSVC v142 - VS2019 C++ x64/x86 Spectre-mitigated libs (v14.29-16.11)(Latest)" .

Related

OpenCV 2.4.2 library files using CMake and MinGW - Target IDE CodeBlocks

I have been having this issue with OpenCV 2.4.2 that it doesn't really get installed properly with Microsoft VS 2010 Express; It is always missing a dll file or two doesn't matter what I follow by Googling. Also, Visual Studio 2010 Express is only valid for a few days, so it is acceptable that VS will not behave well with OpenCV at that point. However, when I changed my IDE to CodeBlocks, it is even stranger because now I have missing dll files and also "Missing Entry Point" error because of a duplicate .dll file. I found this guide and followed what it told me to do:
http://conanhung.wordpress.com/2012/05/23/opencv-2-2c-codeblocks-and-mingw-got-it-working-on-windows/
But it still doesn't work!! What I am after is a complete and definitive solution to integrating OpenCV (preferrably 2.4.2 version) on a Windows 7 64-bit machine. I have been turning Stackoverflow inside out but no solution is working for me. The problems are
WHEN USING VISUAL STUDIO:
Missing dll file (e.g. libopencv_core242d.dll, etc.)
WHEN USING CODE BLOCKS:
First it complains that libstdc++-6.dll is missing. When I download it to my C:\MinGW\libexec\gcc\mingw32\4.7.0 folder, it stops complaining about this. But now it complains that there is any entry point problem and some other .dll file is missing!!!
If someone has managed to make it work by hook or crook, I will be more than happy to know what it is, IN DEPTH. I don't believe that such an important library can be so stupidly distributed so that developers have to struggle night and day to make this work.
FYI, I have tried even the OPenCV website and frankly their instructions are a bit useless. Also, all the necessary information e.g. adding PATH, adding includes and libraries, etc. Please someone point me to the right direction as it has been two days and I cannot get anywhere. It is literally stopping my job now :(
As an answer, but probably a very simple one, I did the following and got rid of the problem:
1) Uninstalled code::blocks completely from the PC and downloaded the IDE-only version (i.e. withouth MinGW compiler), then installed it.
2) Downloaded the latest stable version of MinGW, installed, and added C:\MinGW\bin to PATH
3) Followed rest of the instructions from [link] http://conanhung.wordpress.com/2012/05/23/opencv-2-2c-codeblocks-and-mingw-got-it-working-on-windows/
4) Just to be sure, copied the opencv .dll files from the build folder (i.e. the one that you have created "make" and "install" files using CMake) to the debug (i.e. the executables') folder.
This will fix the problems. In case, it doesn't it might be that you need to add some environment variables.

Does NuGet Update UI work at all?

It just baffles me that even though upddates show up in the Manage NuGet Packages UI for a solution, clicking the update button results in a process that looks like it should work and then fails at the end for no apparent reason. I always have to fall back to uninstalling by hand, removing the project references for the library, and manually deleting the reference from the project file. (Why remove does not do this I have no idea.)
My Setup:
VS2012RC - maybe this works in VS2012RTM?
NuGet v2.1 - the latest as far as I know
F# - I've only been working in F# lately, maybe the problem is specific to F#?
FSharpx.Core - this is the library I update all the time, but I have experienced it with others
At first the messages look like it is working (upgrading from 1.6.78 to 1.6.83)
Added file 'FSharpx.Core.1.6.83.nupkg' to folder 'FSharpx.Core.1.6.83'.
etc.
Successfully installed 'FSharpx.Core 1.6.83'.
'FSharpx.Core 1.6.83' already installed.
Looking for updates for 'FSharpx.Core'...
Updating 'FSharpx.Core' from version '1.6.78' to '1.6.83' in project 'DS_Benchmark'.
'packages.config' already exists. Skipping...
Successfully removed 'FSharpx.Core 1.6.78' from DS_Benchmark.
'packages.config' already exists. Skipping...
Maybe skipping 'packages.config' is the problem, since the version should be updated in that file.
Then the messages start looking bad. Just installed files start getting removed.
Removed file 'FreebaseTypeProvider.htm' to folder 'C:\Users\Jack\Documents\GitHub\DS_Benchmark\packages\FSharpx.Core.1.6.83\...
etc.
Successfully uninstalled 'FSharpx.Core 1.6.83'.
(As an aside, could NuGet please use the correct preposition for "remove" in their message?)
It's a bug in NuGet 2.1, or else a change to the F# project system in VS 2012 that breaks NuGet.
http://nuget.codeplex.com/discussions/395351
They've acknowledged the problem, and pledge to have it fixed in NuGet 2.2. In the meantime, you can help by voting for the bug, and also this other NuGet/F#/VS2012 bug.

DWScript Install

I'm trying to install DWScript in XE2 and I seem to be struggling. I can't find any up to date installation instructions, and the older instructions I did find no longer seems applicable.
I've tried both head from the svn repository, and also one of the previous releases and haven't had much luck with either.
I've added the source directory to my library path.
When I opened dwsLib originally I had a TdwsUnit not found message, although it appears to compile. Both dwsLibDesignOnly and dwsLibRuntime.dpk have an error about dwsCodeGen which is missing, and it appears there is a whole JSCodeGen directory in Libraries which doesn't exist but should.
Any help would be much appreciated.
Thanks,
Richard
You can try revision r1462.
After that revision project owner decide to close source for JavaScript CodeGen and contunue development only for MobileStudio product.
The CodeGen is no longer maintained in the SVN, and the dpks were a bit out of date (updated now). You can just remove the units/classes it doesn't find from the .dpk
For further details on the CodeGen see http://delphitools.info/2012/05/18/from-op4js-to-smart-mobile-studio/
The last open-source version can be found in r1462 of the SVN.

OpenCV 2.1 Strange Errors

I'm not sure if this is the right place for asking these kind of question but I have no better place in mind.
After LOTS of coding in OpenCV, I'm trying to migrate to new C++ interface of openCV which has been introduced in OpenCV 2.0. but I keep getting strange errors.
For example:
trying to use pre-built dlls and libs, I got exceptions in "cv::warpAffine" and "findContours" cv::function at runtime. I compiled the openCV, used my own build of libs and dlls and everything got fixed!
the same problem happened in linux.
linking the "Debug" built dlls with "Release" built of program cause some unexpected runtime errors, and vice versa.
and some other errors.
can anyone helping me with what I'm doing wrong? (please keep in mind that I coded alot with older version of openCV).
When I migrated to C++ interface I couldnt make openCV work until I compiled the source by myself. Probably DLL's and Libs that are installed with opencv are good only to a specific machine.
Another thing. Try to do the following if you use Visual Studio
go to Project Properties->Click the C/C++ folder->Code Generation->Runtime Library and change it to /MDd in Debug configuration and /MD in release
It solves a problem with esceptions related to STL
Some of the functions ave moved out to new libs (especially some of the stereo functions are in calib3d) and the header file structure is completely changed in 2.2
There are some guides to the configuration eg for visual studio

Anyone got --standalone option to work in F# CTP?

I may have this completely wrong, but my understanding is that the --standalone compiler option tells the compiler to include the F# core and other dependencies in the exe, so that you can run it on another machine without installing any 'runtime'.
However, I can't get this to work in the CTP - it doesn't even seem to change the size of the output file (docs I've read say about 1M extra).
"Google may know, but if it does, it ain't telling, or I'm not looking in the right place"
UPDATE:
It seems to work with latest CTP update 1.9.6.2
UPDATE2:
I have since experienced another error:
FSC(0,0): error FS0191: could not resolve assembly Microsoft.Build.Utilities.
If you get errors like this when trying to compile --standalone, you need to explicitly include them as references in your project.
Answer from MS:
There is a CTP update 1.9.6.2 that fixed some --standalone bugs.
I'm reinstalling now...
UPDATE:
Works for me - so the my accepted answer is download CTP update 1.9.6.2.
F# manual: Statically linking the F# library using "--standalone"
Did you try to run peverify.exe utility?
This has been a pet hatred of mine for a long time (it has been broken in every CTP release ever including the latest 1.9.6.16 May 2009 release). The "solution" is essentially to write your own build system that is not broken.
This is a real problem for me because I have accumulated hundreds of great F# programs that I would like to put on our site but it takes hours to build each one into a standalone executable.

Resources