The C++ compiler “mangles” the exported name, imbedding parameter
information, etc, so “_DriverEntry@8” becomes something very different
like “DriverEntry$SOMESTRINGOFCHARACTERS”.
Add ‘extern"C"’ to any functions that need to be exposed, such as
DriverEntry(). Change:
NTSTATUS DriverEntry( …, … )
to
extern “C” NTSTATUS DriverEntry( …, … ).
You should also wrap extern “C” around header files. The declaration
CPLUSPLUS is automatically defined for cpp files.
#ifdef CPLUSPLUS
extern “C”
{
#endif
#include …
#include …
#include …
#ifdef CPLUSPLUS
}
#endif
Bryan S. Burgin
xxxxx@microsoft.com
This posting is provided “AS IS” with no warranties, and confers no
rights.
-----Original Message-----
From: Matt Lynch [mailto:xxxxx@earthling.net]
Sent: Tuesday, August 06, 2002 6:01 PM
To: File Systems Developers
Subject: [ntfsd] Weird errors - C and C++
Hi all,
Platform: VC++ 6.0, SP5, Win2k Pro Sp3, Win2k DDK
I’ve got a weird problem, that I was hoping someone might have some
input on. I’ve got a disk class driver that I’ve been building, and
during compiling I kept getting an “LNK2001: unresolved external
_DriverEntry@8”. After a bit of debugging, I cut my program down to the
bare bones, and it came down to the fact that my DriverEntry() was in a
.Cpp file, instead of a .c file. After renaming the file to .c, the
program compiled, but then when I added a few classes into the app, it
failed to build, complaining about keyword: class, public, private. It
seems odd to me that C++ is not supported, and figured it’s got to be
some small setting i’ve missed. Anyone have some pointers on what I can
do to resolve this?
Thanks,
Matt.
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
Get 4 DVDs for $.49 cents! plus shipping & processing. Click to join.
http://adfarm.mediaplex.com/ad/ck/990-1736-3566-59
You are currently subscribed to ntfsd as: xxxxx@microsoft.com
To unsubscribe send a blank email to %%email.unsub%%