473,325 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Help with LNK2019 error and DiInstallDriver function

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
For the life of me I can't figure out why it's giving me this error.
The function is in declared in newdev.h and I am including that in
my .cpp file. UpdateDriverForPlugAndPlayDevices() is defined in hte
same newdev.h and works fine.

I don't know if this is happening because DiInstallDriver() is a VISTA
function and I'm building on a XP machine or what, but it is driving
me crazy! Any help would be VERY MUCH appreciated it.

Here's a snippet of what my code looks like:
if(osMajorVersion 5)
{

if(ForceUpdate) installFlag = DIIRFLAG_FORCE_INF;
installResult = DiInstallDriver(0, inf, installFlag,
&rebootRequired);
} else
{
if(ForceUpdate) installFlag = INSTALLFLAG_FORCE;
installResult =
UpdateDriverForPlugAndPlayDevices(0,hwid,inf,insta llFlag,&rebootRequired);
}

TIA!

Apr 11 '07 #1
1 3944
Rymfax wrote:
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
For the life of me I can't figure out why it's giving me this error.
The function is in declared in newdev.h and I am including that in
my .cpp file. UpdateDriverForPlugAndPlayDevices() is defined in hte
same newdev.h and works fine.

I don't know if this is happening because DiInstallDriver() is a VISTA
function and I'm building on a XP machine or what, but it is driving
me crazy! Any help would be VERY MUCH appreciated it.

Here's a snippet of what my code looks like:
if(osMajorVersion 5)
{

if(ForceUpdate) installFlag = DIIRFLAG_FORCE_INF;
installResult = DiInstallDriver(0, inf, installFlag,
&rebootRequired);
} else
{
if(ForceUpdate) installFlag = INSTALLFLAG_FORCE;
installResult =
UpdateDriverForPlugAndPlayDevices(0,hwid,inf,insta llFlag,&rebootRequired);
}

TIA!
Try a Microsoft newsgroup.

None of this is Standard C++; which is what this
newsgroup addresses. See here for some possible
related newsgroups:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Apr 11 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vishal Saxena | last post by:
Hi, I am new to this news group, hope to get prompt solution from you, gurus of VC. Well i had a project developed in VC++ 6.0, it uses Adobe Plugin Development SDK, I am trying to upgrade my...
1
by: Hadi | last post by:
Hi, I have two files libqdbm.dll.a and qdbm.dll. In cygwin libqdbm.dll.a is located in /usr/local/lib while qdbm.dll is located in windows/system32. I have my test project which I compiled in...
3
by: YAN KANG / SU | last post by:
Hi, All I am migrating to Studio .NET 2003 from Studio 6.0 and Studio .NET 2002. When I compiled my code, which is compilable both in VC++ 6.0 and Studio .NET 2002, I have an error LNK2019 as the...
3
by: Chris B | last post by:
Im trying out VS.NET 2003 by trying to make my own single linked list library. Im trying to use templates but keep getting LNK2019 errors. Right now I slimmed down my project to just the main.cpp,...
2
by: hazizpour | last post by:
Hello I hope I am in the correct newsgroup, if not please let me know. I am trying to build a sample for using a certain library ( IFC mapping to C++ classes, see www.cstb.fr) with MS Visual...
2
by: rangalo | last post by:
Hi All, I have succeeded in compiling a massive project, originally from vc6 to VS .Net 2005. Now, while linking I am having loads of linker errors with the above code. LNK20019 and LNK2001....
1
by: Rymfax | last post by:
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...
4
by: jk2l | last post by:
Error 10 error LNK2019: unresolved external symbol __imp__glBindTexture@8 referenced in function "public: void __thiscall GLTexture::Use(void)" (?Use@GLTexture@@QAEXXZ) GLTexture.obj Error 11 error...
2
by: hjazz | last post by:
Hi all, I'm new to VS, and I'm using Visual Studio .NET 2003. I'm trying to write a program which uses pcap libraries. However, I keep getting the following errors: error LNK2019: unresolved...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.