I am unable to build a driver as soon as I change the file extension from
.c to .cpp
All I have in my file is the driver entry routine which works just fine
with the .c file but gives me the following error when I change it to .cpp
link() : error LNK2001: unresolved external symbol _DriverEntry@8
objchk\i386\sample.sys() : error LNK1120: 1 unresolved externals
BTW, I have changed my SOURCES file to reflect the right extension
Does anyone know how to get rid of this problem. I would especially like to
use .cpp because of its strong type checking among other things.
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Try to use extern C declaration for the PNP callback functions.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of xxxxx@hotmail.com
Sent: Tuesday, March 27, 2001 3:11 AM
To: NT Developers Interest List
Subject: [ntdev] Conversion from .c to .cpp files
I am unable to build a driver as soon as I change the file extension from
.c to .cpp
All I have in my file is the driver entry routine which works just fine
with the .c file but gives me the following error when I change it to .cpp
link() : error LNK2001: unresolved external symbol _DriverEntry@8
objchk\i386\sample.sys() : error LNK1120: 1 unresolved externals
BTW, I have changed my SOURCES file to reflect the right extension
Does anyone know how to get rid of this problem. I would especially like to
use .cpp because of its strong type checking among other things.
You are currently subscribed to ntdev as: xxxxx@powernetsys.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
hi,
use this in your *.cpp file
extern “C” NTSTATUS
DriverEntry( … )
{
}
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Hi,
The DriverEntry() function (such as all the other callbacks you set in your
driver object) has to be declared as a C function.
So, if this function is in a ‘.cpp’ file, put the tag ‘extern “C”’ at the
begining of the function :
extern “C” NTSTATUS DriverEntry ( PDRIVEROBJECT aDriverObject,
PUNICODE_STRING aRegistryPathPt )
{
…
}
Regards,
Serge De Luca
De=A0: xxxxx@hotmail.com
R=E9pondre =E0=A0: NT Developers Interest List
> Date=A0: Tue, 27 Mar 2001 05:10:53 +0200
> =C0=A0: NT Developers Interest List
> Objet=A0: [ntdev] Conversion from .c to .cpp files
>=20
> I am unable to build a driver as soon as I change the file extension
> from=20
> .c to .cpp
> All I have in my file is the driver entry routine which works just fine
> with the .c file but gives me the following error when I change it to
> .cpp
>=20
> link() : error LNK2001: unresolved external symbol _DriverEntry@8
> objchk\i386\sample.sys() : error LNK1120: 1 unresolved externals
>=20
> BTW, I have changed my SOURCES file to reflect the right extension
> Does anyone know how to get rid of this problem. I would especially like
> to=20
> use .cpp because of its strong type checking among other things.
>=20
> —
> You are currently subscribed to ntdev as: xxxxx@laciegroup.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
It also helps to wrap ntddk.h in extern “C” { }.
Mark Roddy
xxxxx@hollistech.com
www.hollistech.com
603 321 1032
WindowsNT Windows 2000 Consulting Services
-----Original Message-----
From: Serge De Luca [mailto:xxxxx@laciegroup.com]
Sent: Tuesday, March 27, 2001 6:24 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Conversion from .c to .cpp files
Hi,
The DriverEntry() function (such as all the other callbacks you set in your
driver object) has to be declared as a C function.
So, if this function is in a ‘.cpp’ file, put the tag ‘extern “C”’ at the
begining of the function :
extern “C” NTSTATUS DriverEntry ( PDRIVEROBJECT aDriverObject,
PUNICODE_STRING aRegistryPathPt )
{
…
}
Regards,
Serge De Luca
De : xxxxx@hotmail.com
R?pondre ? : NT Developers Interest List
> Date : Tue, 27 Mar 2001 05:10:53 +0200
> ? : NT Developers Interest List
> Objet : [ntdev] Conversion from .c to .cpp files
>
> I am unable to build a driver as soon as I change the file extension
> from
> .c to .cpp
> All I have in my file is the driver entry routine which works just fine
> with the .c file but gives me the following error when I change it to
> .cpp
>
> link() : error LNK2001: unresolved external symbol _DriverEntry@8
> objchk\i386\sample.sys() : error LNK1120: 1 unresolved externals
>
> BTW, I have changed my SOURCES file to reflect the right extension
> Does anyone know how to get rid of this problem. I would especially like
> to
> use .cpp because of its strong type checking among other things.
>
> —
> You are currently subscribed to ntdev as: xxxxx@laciegroup.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>such as all the other callbacks you set
you don’t need to declare callbacks as extern “C”. DriverEntry is the only extern “C” routine.
Regards,
Max
??: Serge De Luca[SMTP:xxxxx@laciegroup.com]
???: NT Developers Interest List
???: 27 ??? 2001 ?. 15:24
???: NT Developers Interest List
???: [ntdev] Re: Conversion from .c to .cpp files
Hi,
The DriverEntry() function (such as all the other callbacks you set in your
driver object) has to be declared as a C function.
So, if this function is in a ‘.cpp’ file, put the tag ‘extern “C”’ at the
begining of the function :
extern “C” NTSTATUS DriverEntry ( PDRIVEROBJECT aDriverObject,
PUNICODE_STRING aRegistryPathPt )
{
…
}
Regards,
Serge De Luca
De?: xxxxx@hotmail.com
R?pondre ??: NT Developers Interest List
> Date?: Tue, 27 Mar 2001 05:10:53 +0200
> ??: NT Developers Interest List
> Objet?: [ntdev] Conversion from .c to .cpp files
>
> I am unable to build a driver as soon as I change the file extension
> from
> .c to .cpp
> All I have in my file is the driver entry routine which works just fine
> with the .c file but gives me the following error when I change it to
> .cpp
>
> link() : error LNK2001: unresolved external symbol _DriverEntry@8
> objchk\i386\sample.sys() : error LNK1120: 1 unresolved externals
>
> BTW, I have changed my SOURCES file to reflect the right extension
> Does anyone know how to get rid of this problem. I would especially like
> to
> use .cpp because of its strong type checking among other things.
>
> —
> You are currently subscribed to ntdev as: xxxxx@laciegroup.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: xxxxx@telecom.sins.ru
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> link() : error LNK2001: unresolved external symbol _DriverEntry@8
objchk\i386\sample.sys() : error LNK1120: 1 unresolved externals
Declare DriverEntry as extern “C”
Max
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com