[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: Help me to resolve undefined reference
From: Francois Gouget <fgouget () free ! fr>
Date: 2002-03-29 2:06:08
[Download RAW message or body]
On Thu, 28 Mar 2002, Ku Cheng wrote:
> Andriy,
>
> After putting the prototype of DisconnectNamedPipe( ) in the winbase.h
> file, finally my program can link successfully. Previously I put "extern
> bool DsiconnnecrNamedPipe ..." in my source file to avoid compilation
> error. But it still failed at linking phase. What is the difference of
> putting the declaration in winbase.h and in my local file? How is the
> winbase.h used in "winemaker" and "configure"? Is there any documentation
> explaining this?
This is a regular C vs. C++ issue, not specific to Winelib. When you
put it in your source file you were probably missing the "C" in extern
"C" ... In winebase.h all function declarations are enclosed with:
#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
}
#endif
So because "C" was missing, the compiler assumed it was a C++ function
and mangled the name. Then at link time there was no function by that
(mangled) name.
--
Francois Gouget fgouget@free.fr http://fgouget.free.fr/
War doesn't determine who's right. War determines who's left.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic