Tech Support > Microsoft Windows > Drivers > Link problem with VC/C++ 8.0 (Beta) on x86 & x64
Link problem with VC/C++ 8.0 (Beta) on x86 & x64
Posted by Alex on May 9th, 2005


Hello,

using VC/C++ 8.0 to compile my WDM driver (mainly written in C++) I got
the following link error (on x86 & x64). Compiling it with VC/C++ 7.1
linking works without problems.

DrvEntry.obj : error LNK2001: unresolved external symbol "const
type_info::`vftable'" (??_7type_info@@6B@)

The problem seems to be the follwing line:

pclsUsbDrv = dynamic_cast<CUsbDriver*>(new CUsbDriver);

When I delete this line it compiles. But I need this line...
Static allocating as global parameter also occurs the same error.
Is there are a special lib I have to add?
Any hints are welcome.

TIA
Alex

Posted by Don Burn on May 9th, 2005


First, you should only be using the compiler from the DDK to build kernel
code, anything else will cause subtle bugs (or in this case not so subtle)
that will bight you. Second, be extremely careful with C++ in the kernel,
using anything other than C requires a lot of care (which because you are
already playing fast and loose with the wrong compiler is doubtful that you
have applied this care).


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply


"Alex" <alex130671@nexgo.de> wrote in message
news:427f4c3e$0$7525$9b4e6d93@newsread2.arcor-online.net...


Posted by Alex on May 9th, 2005


Don Burn wrote:
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40310.41 for AMD64
solves the problem instead of using
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50215.44 for x64

Thanks
Alex

Posted by Doron Holan [MS] on May 9th, 2005


RTTI is not supported in the kernel. you can't use it. that means no
dynamic_cast or its ilk for instance.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Alex" <alex130671@nexgo.de> wrote in message
news:427f5ead$0$10500$9b4e6d93@newsread4.arcor-online.net...



Similar Posts