linking problem in driver
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
linking problem in driver

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> File System
Author Message
sushantp
Guest





Posted: Mon Oct 25, 2004 9:43 pm    Post subject: linking problem in driver Reply with quote

Hi ,

I am trying to build a FS filter driver wherein i have a .cpp file and some
..c files. I want to use a function from .cpp file in a .c file.

The .cpp file has the desired function declaration in extern "C" { ...}
: extern "C" int abc();
: int abc(){ ... }
and
the .c file has the plain function declaration and uses the function
: int abc();
: void xyz(){ abc(); }

while linking these files together i get "LNK2019 :unresolved external
symbol _abc@0 referenced in function _xyz@0"
When i looked into .obj files for these .cpp and .c files and found "_abc@0"
in both.I think that is what it should be and still i cannot
identify the problem.

The sources file i used looks something like(I have cut the irrelevant
matter) :
TARGETNAME=xyz
TARGETPATH=obj
TARGETTYPE=DRIVER
BASEDIR=..
DRIVERTYPE=FS
USE_MAPSYM=1
USE_NATIVE_EH=1
USER_C_FLAGS=/Tpa.cpp #a.cpp file contains the function to be used
C_DEFINES= /I$(BASEDIR)\include
SOURCES=b.c #b.c file uses the function from a.cpp

Anyone who has encountered similar problem plz help.

Thanx
Sushant
Back to top
Dave August
Guest





Posted: Tue Oct 26, 2004 8:14 pm    Post subject: Re: linking problem in driver Reply with quote

Sushantp,

First you'd probably get a bettter set of responses to your question from

from the news group
microsoft.public.development.device.drivers
they discuss filter drivers over there a lot, this group is more
system/applications stuff..

Second, most people think using CPP in drivers is not a good thing, one of
the problems is that you are not compiling/linking with the compiler/linker
that comes with the DDK and most people feel that for stable drivers
including filters you should use those tools.

Good luck



"sushantp" <sushatnp@covelix.com> wrote in message
news:OVKVgiruEHA.1392@tk2msftngp13.phx.gbl...
Quote:
Hi ,

I am trying to build a FS filter driver wherein i have a .cpp file and
some
.c files. I want to use a function from .cpp file in a .c file.

The .cpp file has the desired function declaration in extern "C" { ...}
: extern "C" int abc();
: int abc(){ ... }
and
the .c file has the plain function declaration and uses the function
: int abc();
: void xyz(){ abc(); }

while linking these files together i get "LNK2019 :unresolved external
symbol _abc@0 referenced in function _xyz@0"
When i looked into .obj files for these .cpp and .c files and found
"_abc@0"
in both.I think that is what it should be and still i cannot
identify the problem.

The sources file i used looks something like(I have cut the irrelevant
matter) :
TARGETNAME=xyz
TARGETPATH=obj
TARGETTYPE=DRIVER
BASEDIR=..
DRIVERTYPE=FS
USE_MAPSYM=1
USE_NATIVE_EH=1
USER_C_FLAGS=/Tpa.cpp #a.cpp file contains the function to be used
C_DEFINES= /I$(BASEDIR)\include
SOURCES=b.c #b.c file uses the function from a.cpp

Anyone who has encountered similar problem plz help.

Thanx
Sushant

Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> File System All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB