I define a new function which is GetDeviceInterfaceSymbolicLinkNew().
When I link it in VC, it appears those faults :

" --------------------Configuration: Test - Win32
Debug--------------------
Linking...
Test.obj : error LNK2001: unresolved external symbol "int __cdecl
GetDeviceInterfaceSymbolicLinkNew(void *,struct _GUID const *,unsigned
long,char * const)"
(?GetDeviceInterfaceSymbolicLinkNew@@YAHPAXPBU_GUID@@KQAD@Z)
Debug/Test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Test.exe - 2 error(s), 0 warning(s) "


I want to use this function in user mode. I don't know if it could
work.
Please give me some hints. Thanks.



Bob

Re: A problem when linking in VC by Doron

Doron
Sun Mar 12 12:39:08 CST 2006

the linker is looking for a C++ version of this function. did you implement
it under an extern "C" block in a CPP file or in a C file? if so, put an
extern "C" declaration on the function prototype in the header and clean
build

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.


"bob" <lnqhzb@hotmail.com> wrote in message
news:1142146463.187662.302900@z34g2000cwc.googlegroups.com...
>I define a new function which is GetDeviceInterfaceSymbolicLinkNew().
> When I link it in VC, it appears those faults :
>
> " --------------------Configuration: Test - Win32
> Debug--------------------
> Linking...
> Test.obj : error LNK2001: unresolved external symbol "int __cdecl
> GetDeviceInterfaceSymbolicLinkNew(void *,struct _GUID const *,unsigned
> long,char * const)"
> (?GetDeviceInterfaceSymbolicLinkNew@@YAHPAXPBU_GUID@@KQAD@Z)
> Debug/Test.exe : fatal error LNK1120: 1 unresolved externals
> Error executing link.exe.
>
> Test.exe - 2 error(s), 0 warning(s) "
>
>
> I want to use this function in user mode. I don't know if it could
> work.
> Please give me some hints. Thanks.
>
>
>
> Bob
>



Re: A problem when linking in VC by bob

bob
Sun Mar 12 21:19:31 CST 2006

I add this
" #ifdef __cplusplus
extern "C"
#endif "

The result is

" E:\usbtest(f)\addfilter\device interface class>build
BUILD: Object root set to: ==> objchk
BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.
BUILD: /i switch ignored
BUILD: Compile and Link for i386
BUILD: Loading c:\WINDDK\2600\build.dat...
BUILD: Computing Include file dependencies:
BUILD: e:\usbtest(f)\addfilter\device interface class\sources.(13):
Unsupported
TARGETTYPE value - WDM
BUILD: Examining e:\usbtest(f)\addfilter\device interface class
directory for fi
les to compile.
e:\usbtest(f)\addfilter\device interface class - 1 source files
(132 lines)
BUILD: Saving c:\WINDDK\2600\build.dat...
BUILD: Compiling e:\usbtest(f)\addfilter\device interface class
directory
BUILD: Done
"
The function is defined by myself. Whether the problem is here or not
? Thanks


Re: A problem when linking in VC by Doron

Doron
Mon Mar 13 00:31:55 CST 2006

it's unclear what is going on.

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.


"bob" <lnqhzb@hotmail.com> wrote in message
news:1142219971.560136.18070@j33g2000cwa.googlegroups.com...
>I add this
> " #ifdef __cplusplus
> extern "C"
> #endif "
>
> The result is
>
> " E:\usbtest(f)\addfilter\device interface class>build
> BUILD: Object root set to: ==> objchk
> BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.
> BUILD: /i switch ignored
> BUILD: Compile and Link for i386
> BUILD: Loading c:\WINDDK\2600\build.dat...
> BUILD: Computing Include file dependencies:
> BUILD: e:\usbtest(f)\addfilter\device interface class\sources.(13):
> Unsupported
> TARGETTYPE value - WDM
> BUILD: Examining e:\usbtest(f)\addfilter\device interface class
> directory for fi
> les to compile.
> e:\usbtest(f)\addfilter\device interface class - 1 source files
> (132 lines)
> BUILD: Saving c:\WINDDK\2600\build.dat...
> BUILD: Compiling e:\usbtest(f)\addfilter\device interface class
> directory
> BUILD: Done
> "
> The function is defined by myself. Whether the problem is here or not
> ? Thanks
>