- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
I want to build a simple "int main(){ return 0; }" program that passes the API Validator OneCore compatibility test.
After reading https://msdn.microsoft.com/en-us/windows/hardware/drivers/develop/getting-started-with-universal-drivers and https://msdn.microsoft.com/en-us/library/windows/desktop/mt654040(v=vs.85).aspx I proceeded to build a simple default solution in VS2015 u3 on my Windows 10 build 14393 system with the program described above.
If my platform toolset is "WindowsApplicationForDrivers10.0" or even "Visual Studio 2015 (v140)", running the API Validator that comes with the Windows SDK as a post-build event succeeds:
"C:\Program Files (x86)\Windows Kits\10\bin\x64\apivalidator.exe" -driverpackagepath:"$(OutDir)\" -SupportedApiXmlFiles:"C:\Program Files (x86)\Windows Kits\10\build\universalDDIs\$(Platform)\UniversalDDIs.xml" -ModuleWhiteListXmlFiles:"C:\Program Files (x86)\Windows Kits\10\build\universalDDIs\$(Platform)\ModuleWhiteList.xml"
If I switch the Platform Toolset to Intel C++ Compiler 17.0 u2, I get warnings that my executable now has a dynamic dependency on ntdll.dll, which is not OneCore compliant. According to my investigations, this is because libirc.lib was linked with a dependency on ntlib.lib and the warnings appear for printf, vsnprintf, scanf, and variations of those functions.
Is it possible to generate a libirc.lib such that it ignores these default dependencies? This would allow the person building the executable or dll to choose the OneCore umbrella library (OneCore.lib) or the traditional desktop library (ntdll.lib) as the means to resolve those dependencies instead of having that decision being made in the libirc.lib.
Thank you.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>My question is what problems do you have with that dependency?
This dependency makes the resulting executable get a warning when running the API validator. I want to not have that warning. Adding
/NODEFAULTLIB:"ntlib.lib"
to the executable build doesn't change that because libirc.lib already indicated it would use ntdll.lib and its corresponding ntdll.dll.
I want OneCoreUap.lib to be used so that they symbol is resolved in api-ms-win-crt-stdio-l1-1-0.dll.
I am not sure switching to MinGW C++ compiler will help, I can try. But even if it worked, I want to use the Intel Compiler in my product.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another way to state it is that the linker directives below should not have default libraries. Instead it should be left to whoever is building the .exe or .dll to select the libraries needed
OR
A different libirc.lib that is specific for OneCore systems should be built, and that version uses OneCore.lib and ignores the other libs listed below.
> dumpbin /directives libirc.lib
Microsoft (R) COFF/PE Dumper Version 14.00.24215.1
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file libirc.lib
File Type: LIBRARY
Linker Directives
-----------------
-defaultlib:uuid.lib
-defaultlib:uuid.lib
Linker Directives
-----------------
-defaultlib:uuid.lib
-defaultlib:uuid.lib
-defaultlib:kernel32.lib
Linker Directives
-----------------
-defaultlib:uuid.lib
-defaultlib:uuid.lib
-defaultlib:kernel32.lib
-defaultlib:ImageHlp
Linker Directives
-----------------
-defaultlib:uuid.lib
-defaultlib:uuid.lib
-defaultlib:kernel32.lib
Linker Directives
-----------------
-defaultlib:uuid.lib
-defaultlib:uuid.lib
-defaultlib:kernel32.lib

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page