Help with LNK2019 error and DiInstallDriver function

R

Rymfax

Hello, I was hoping someone could help me with a compile issue I'm
having in Visual Studio 2005 using the v6.0 Microsoft SDK. I
apologize in advance if I'm posting to any groups that don't relate to
this topic. I'm just trying to hit the groups that seem relevant.

I have an application that is installing Drivers to the OS. I was
using the UpdateDriverForPlugAndPlayDevices() function to handle
this. It works fine, but on VISTA I get prompted by Windows Security
if the Driver isn't pre-installed first. To avoid this I want to use
the DiInstallDriver() function which will Pre-Install the driver first
and then install it to any device that uses it.

The problem I'm having is that everytime I try to compile now that
I've added a reference in my code to DiInstallDriver(), I get the
following error:

Error 13 error LNK2019: unresolved external symbol _DiInstallDriverW
referenced in function "private: void __thiscall
ScanHardware::UpdateDriver(class ScanResult *)" (?
UpdateDriver@ScanHardware@@AAEXPAVScanResult@@@Z) ScanHardware.obj
Error 14 fatal error LNK1120: 1 unresolved externals C:\Projects
\UIUHWScan++\Debug\UIUHWScan++.exe 1

I'm a relative novice in the area of C++, so ANY help would be
greatly appreciated.
 
B

Ben Voigt

Rymfax said:
Hello, I was hoping someone could help me with a compile issue I'm
having in Visual Studio 2005 using the v6.0 Microsoft SDK. I
apologize in advance if I'm posting to any groups that don't relate to
this topic. I'm just trying to hit the groups that seem relevant.

I have an application that is installing Drivers to the OS. I was
using the UpdateDriverForPlugAndPlayDevices() function to handle
this. It works fine, but on VISTA I get prompted by Windows Security
if the Driver isn't pre-installed first. To avoid this I want to use
the DiInstallDriver() function which will Pre-Install the driver first
and then install it to any device that uses it.

The problem I'm having is that everytime I try to compile now that
I've added a reference in my code to DiInstallDriver(), I get the
following error:

From the DiInstallDriver documentation:

"Declared in newdev.h. Include newdev.h. Link to newdev.lib. "


However, since this is a Vista-only function, I would suggest that you use
LoadLibrary and GetProcAddress to call it if available, that way your app
won't totally refuse to run on XP and earlier.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

LNK2019 error 2
LNK2019 problems 4
unresolved external symbols 2
CDatabase error 1
LNK2019 Errors with Templates 3
Using VS7.0 to test an SDK made on VS8.0 4
Linker error 1
Strange issues with linking 3

Top