Windows Driver Kit Cannot Open ddk/ntddk.h - wdk

So im currently trying to make a driver.
And when i add:
#include <ddk/ntddk.h>
I get the error: Cannot open source file "ddk/ntddk.h". How do i fix this?

Which version of the WDK are you using?
For WDK 8 and above, there is no directory called ddk shipped by the WDK, so the include that you have wouldn't work... Just look at where exactly on your disk is ntddk.h located, and make sure that the additional include directories specified in the compiler options include whichever location has ntddk.h. By default, in WDK 8 and above, it should be (and thus you don't need a ddk/ prefix).

Related

How to create 32-bit dll file for OpenCV version 4.0.1?

I have tried many methods to build a 32-bit version of OpenCV version 4.0.1, however to no avail. I have tried using CMake and the file I require is opencv_world401.dll
May I know if anyone has any steps for me to follow to build the 64 bit source code so that I can have a complete 32-bit package in return? It seems there will be missing files when I use CMake.
Thank you!
Tried using CMake to build the 64 bit source code into a 32 bit package
Currently OpenCV_world401.dll is giving me a winerror 193
I have the same problem. It would be resolved easily. Firt, you need to download your intended version, in this case, under OpenCV – 4.1.2 section choose Windows from https://opencv.org/releases/.
Then, download the executable file, run it, and extract it wherever you want. Afterward you will be able to find, for example, opencv_world401.dll under "opencv\build\x64\" folder.
The opencv source code is platform in-dependent, which means you can build dll/so files for different platform with this same source code tree. But to get a Win32 build you'll have to make some change during "Configuration" step, because by default it will generate a x64 platform build.
Basically that's the only change required.
If you can read Chinese, here's a detailed tutorial for you to reference:
https://www.csdn.net/tags/OtDaQg0sODk1MS1ibG9n.html

Why does $KMDFCOINSTALLERVERSION$ evaluate to semicolon?

The Context
This question is related to the RAMDisk Storage Driver Sample, but also applies to the Toaster Sample Driver, and may even apply to any driver that make use of .INX files and CoInstallers.
My original question was "Why am I missing the WdfCoInstallerXXXXX.dll file when my build was successful?" After reviewing the ramdisk.inf file, I realized that all the coinstaller sections are empty (replaced with a semicolon). This lead me to the question below.
The Question
The coinstaller section of the ramdisk.inx file make use of the $KMDFCOINSTALLERVERSION$ variable. This should be a valid variable according to this page. However, upon successful build, all lines that reference the $KMDFCOINSTALLERVERSION$ variable evaluate to a semicolon in the generated ramdisk.inf file. Why?
Additional Information
All other variables in the ramdisk.inx files, such as $KMDFVERSION$ and $ARCH$, gets evaluated properly.
The Cause
It turns out that the cause of this was the fact that I don't have the specified KMDF library version install, even though I recently installed the latest WDK 10. According to this page, "if you omit the KMDF Version Minor, the most recent minor version is used."
In other words, I was trying to use KMDF version 1.15, when I only support 1.7, 1.9, and 1.11. You can check the redistributable directory to see which version you support. Mine is located at C:\Program Files (x86)\Windows Kits\10\Redist\wdf\x64.
The Fix
Go to Project->Properties->Driver Settings->Driver Model, and select the appropriate KMDF version. After that, rebuild, and your .INF file will be properly populated, and your driver package will contain the appropriate WdfCoInstallerXXXXX.dll.

Failed to load platform plugin "windows". Available platforms are : Error

I've created Qt project using Visual studio 2012 32 bit and Qt5 SDK with the help of Visual studio Qt addon. I'm using Windows 7 ultimate OS.
I have created QApplication GUI Project which basically uses the following libraries:
qtmain.lib
Qt5Core.lib
Qt5Gui.lib
Qt5Network.lib
Ws2_32.lib
Winhttp.lib
Winmm.lib
Qt5Widgets.lib
Qt5PlatformSupport.lib
imm32.lib
And I have succeed in building the application binary without any errors.
I’m trying to run this application on test machine windows 7 desktop having following dlls copied there:
icudt51.dll
icuin51.dll
icuuc51.dll
libEGL.dll
libGLESv2.dll
Qt5Core.dll
Qt5Network.dll
Qt5GUI.dll
Qt5Widgets.dll
qwindows.dll [copied from msvc2012\plugins\platform folder ]
I’m getting the error:
Failed to load platform plugin “windows”. Available Platform are : while trying to run the application.
What would i have missed? How to make it run on windows platform? Please Help me to troubleshoot this.
I've followed the links posted about this problem previously. but none of them are solved my problem. What configuration I am missing?
The platform plugin dlls would need to be put into the platforms subfolder and then it will work.
Yet another solution: Early in your main function or whatever, call QCoreApplication::addLibraryPath(). A simple example:
std::ifstream configurationStream("whateverNameYouWant.conf");
std::stringstream configurationText;
configurationText << configurationStream.rdbuf();
auto ct = configurationText.str();
if (!ct.empty())
QCoreApplication::addLibraryPath(QString::fromStdString(ct));
Here I load the path from a .conf file of my own invention, so that the path won't be hardcoded into my program. Since I invented this file, I control its format; in this case it contains nothing but the path. The actual path I'm using is C:/qt5/qtbase/plugins; that directory contains platforms/qwindows.dll and other such files. One may adjust the paths for one's own case according to where one's Qt files are installed.
I guess it is also supposed to be possible to use a standard qt.conf file, using a format specified by Qt, to automatically load some special paths (including this plugins path) without having to add special code to your own program for the purpose: http://doc.qt.io/qt-5/qt-conf.html ...But I haven't ever managed to get that to work, for whatever reason. Maybe I'm making some simple mistake, I dunno.
An other solution is to add arguments to the QApplication object (or to the starting application).
For instance, you want to load qwindow.dll from C:\test\platforms.dll, you can instanciate QApplication object with the following code :
int ac = 4;
static char * av[] = {"myappli.exe","C:\\\\path\\to\\myappli.exe","-platformpluginpath","C:\\\\test"};
m_qApp = new QApplication(ac, av);
Be careful, the QTCore dll can't be into the directory C:\test (loading dll conflict)
If you specify a working directory different than the one where your executable is located, no matter the plugins are there, it will fail.
So, in that case, copy your file with a post build event.
And in:
Configuration properties->Debugging->Command
specify the full path of the executable.
This was tested on VStudio 2008.

I have installed WxWidgets, but PgAdmin cannot see it

There was a similar question (here or on some related SE site), but I didn't find so I ask a new question (if you find it, send a link and vote to close this question if they are too similar).
I have finished installing WxWidgets (configure; make; make install), but while installing PgAdmin III 1.16 the make console doesn't recognize WxWidgets as installed. I found that absence of Unicode might be a problem in this case, but I have enabled the Unicode. What else should I do?
I have 32bit Windows XP and WxWidgets 2.9.4. Including PostgreSQL 9.1.3 went OK.
EDIT: I tried another way - through Visual Studio and Visual C++. I don't know if my problem is the same or just similar, but Visual Studio reports this error:
error C1083: Cannot open include file: 'wx/wxprec.h': No such file or directory
followed by 100 of other errors which seem to be conclusion of this one (mostly undefined types/functions with names beginning with "wx"). I added semicolons to the header (as was suggested here - fourth entry after "all replies"), but it didn't help. I also tried to add "include" and "lib" directories in WxWidgets to include path for every project, but no joy here.
Do anybody know how to solve it?
You need to point pgAdmin to wxWidgets installation under Windows. Its build instruction should explain how to do it but you must set up the include path (-I compiler option) and the libraries path (-L linker option) for it to compile and link properly.
Notice that for the include paths you must put the directory containing the wx/setup.h file generated during the build by configure first and the directory with all the rest of wx headers later.
Also, it probably goes without saying, but you must use the same compiler to build both wxWidgets and pgAdmin, so if you built wx using configure+make you can't use MSVC for pgAdmin.

Cross compiler default include path setup

First, some background: I'm attempting to write drivers and applications for Android on the Beagleboard-xM.
I've downloaded their android development kit, installed it, and can succesfully build everything in it using the directions at http://processors.wiki.ti.com/index.php/TI-Android-ICS-4.0.3-DevKit-3.0.0_DevelopersGuide
I've been able to make my own skeleton kernel module following the steps in http://tldp.org/LDP/lkmpg/2.6/lkmpg.pdf without issues. I can copy the .ko file to the android device, insmod, rmmod, etc.
I got tired of the basic shell given by the default build and thought I'd add busybox. I tried following the directions at http://omappedia.org/wiki/Android_Installing_Busybox_Command_Line_Tools, but I get a compile error on standard libc header files.
After digging around quite a bit, I've determined that the pre-built cross compiler provided in the TI android development kit wasn't searching the right paths.
I confirmed this by creating my own .c file that included and tried to compile it with
arm-eabi-gcc blah.c -o blah
and was met with the same results (unable to find the header file in question)
'arm-eabi-gcc -print-prog-name=cc1' -v gives me this:
ignoring nonexistent directory
"/usr/local/google/home/android/cupcake_rel_root/usr/local/include"
ignoring nonexistent directory "/usr/local/lib/gcc/arm-eabi/4.4.3/include"
ignoring nonexistent directory "/usr/local/lib/gcc/arm-eabi/4.4.3/include-fixed"
ignoring nonexistent directory "/usr/local/lib/../arm-eabi/include"
ignoring nonexistent directory "/usr/local/google/home/android/cupcake_rel_root/usr/include"
None of these paths ever existed on my fresh install of ubuntu 10.04. My cross compiler I used is at /usr/TI-Android/prebuilt/linux-86/toolchain/arm-eabi-4.4.3/. I didn't do anything except run the bit .bin file that was the android development kit (which seemed more like simply extracting itself from the .bin file; I don't remember it doing anything else)
So, a few questions:
how the heck did everything else (i.e. android, x-loader, u-boot, the kernel) build by just putting the bin of the cross compile tool into $PATH (like the how-to documents say). I assume it (make menuconfig?) does some magic in fixing up the include paths based on the location of the executable, but...
Why doesn't busybox work the same way since it seems to be built with a similar looking infrastructure?
How do I make it so I can cross compile my own applications?
I assume I've missed a step and should have done some sort of install/configure on the pre-built cross compiler, but information is horribly scant. I appeal to you, open source gods, to point my way across this dark and stormy sea.
For posterity, it seems that the prebuilt tools included with the android development kit are only enough to build the kernel and don't include libc or other library header files. (The NDK tools are 'different' and the build environment is even more different because it has its own version of libc--bionic. That build environment might have been able to build what I wanted, but I would have had to muck with Androidy makefiles, etc.)
I ended up having to get Code Sourcery arm-none-linux-gnueabi (must get the linux-gnueabi one to have the linux system header files needed), and everything worked reasonably smoothly after that.

Resources