Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

error LNK2019 with fopen

0 views
Skip to first unread message

ZachrielCL

unread,
May 19, 2008, 6:34:01 PM5/19/08
to
I get the following error when I try to build a driver for WinXP with "build
/cZ".

error LNK2019: unresolved external symbol __imp__fopen referenced in
function _WcettInit@4

I'm not sure what I am doing wrong. I have USE_MSVCRT=1 on my sources file,
and I'm including stdio.h, but I don't know if I need to include something
else.

I also tried with fopen_s and I get the same error. Any help on this topic
would be greatly appreciated!

Don Burn

unread,
May 19, 2008, 6:45:24 PM5/19/08
to
You cannot use fopen or most of the C language runtime in a device driver.
You should only be using functions documented in the WDK docs.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"ZachrielCL" <Zachr...@discussions.microsoft.com> wrote in message
news:827BCAA4-28A7-4C7A...@microsoft.com...

Pavel A.

unread,
May 20, 2008, 3:37:18 PM5/20/08
to
"ZachrielCL" <Zachr...@discussions.microsoft.com> wrote in message
news:827BCAA4-28A7-4C7A...@microsoft.com...
> I get the following error when I try to build a driver for WinXP with
> "build
> /cZ".
>
> error LNK2019: unresolved external symbol __imp__fopen referenced in
> function _WcettInit@4
>
> I'm not sure what I am doing wrong.

Got wrong sources? Perhaps this stuff is for WinCE.

--PA

ZachrielCL

unread,
May 22, 2008, 10:05:02 AM5/22/08
to
Thank you for your answer! I have searched the documentation for the WDK, but
I haven't found the documentation for it's functions. Do you know of a link
that could take me there?

Don Burn

unread,
May 22, 2008, 3:42:53 PM5/22/08
to
The closest equivalent to fopen/fclose/fread/fwrite would be
ZwCreateFile/ZwClose/ZwReadFile/ZwWriteFile. In the WDK in the index look
under

Windows Driver Kit
Kernel-Mode Driver Architecture
Reference
Driver Support Routines

There is a huge number of functions avaiable.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"ZachrielCL" <Zachr...@discussions.microsoft.com> wrote in message

news:81DE927A-1C6A-44B3...@microsoft.com...

0 new messages