extern "C" ignored?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Lei Jiang (code_at_263.net)
Date: 07/14/04


Date: Wed, 14 Jul 2004 22:45:36 +0800

I have setup a .NET library in C++ language in VS.NET 2005 Beta1. I this
project, I add some additional dependency to some C library. The header file
of the C library has been marked as "extern "C"", but the linker just can't
find these function entries. After I read the error report carefully, I
found that the compiler seems ignored these "extern C" mark.

The linker report :

 Error 13 error LNK2020: unresolved token (0A00001A) "void (__cdecl*__cdecl
ticsSetEofHandler(struct TicsHandle_s *,void (__cdecl*)(struct TicsHandle_s
*,int)))(struct TicsHandle_s *,int)"
(?ticsSetEofHandler@@$$J0YAP6AXPAUTicsHandle_s@@H@Z0P6AX0H@Z@Z)

>From the error message, it looks like that the compiler has ignored these
"extern C".

How could I solve this problem?

Thanks!



Relevant Pages

  • Re: confused about extern use
    ... going to achieve by declaring it as extern in the header file a.h. ... composed on one or more compilation units. ... Essentially you *declare* the type wherever it is ...
    (comp.lang.c)
  • Re: How to debug Link errors of static LIB in eVC?
    ... extern "C" { ... directory of the header file which I had set. ... but your compiler finds somehow the C++ prototype of the function and generates the decorated name for the unresolved external. ... PPlugin_PSoundChannel_WAVFile_Registration_Instance that returns a PPlugin_PSoundChannel_WAVFile_Registration class object. ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: alpha defined: virtualcnt,titleid,keyid,helplineid,pasteboardid
    ... > Where would I best find EXTERN and GLOBAL variables? ... Going back to the C sources: the definitions and (EXTERN) ... thus finding the header file. ... Another way would be to use the CTAGS program, which keeps trace ...
    (comp.os.vms)
  • Re: confused about extern use
    ... I read about extern that whenever we ... So the above style (whatever Nick have given as example) can be ... In the preprocessing operation header file will populate the c- ... extern struct abc abc_var1 ...
    (comp.lang.c)
  • Re: Getting function signature
    ... source code (or at least a declaration in a header file). ... if the function you're looking to call was declared as "extern ... name mangling is turned off (and you can't overload that ...
    (comp.lang.c)