--- Ku Cheng kucheng@cisco.com wrote:
I noticed it and I tried to define it in winbase.h file previously. However it created many errors.
Could you tell me what documentation tells the purpose of this file and the rules of making change to this file?
Hmm. There should not be any problems in adding the call. I'll look into it.
The application compiles and runs well in Win32.
How does this compiled under Windows application runs on Wine?
Please, CC wine-devel list. Somebody else can give us a hand or be interested in the problem. Yes, this will give you 2 instances of the mail, sorry :-(
Andriy Palamarchuk
__________________________________________________ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards� http://movies.yahoo.com/
I created a tiny example which calls DisconnectNamedPipe, added the function declaration to the header. I was able to successfully compile and link the example. Attaching the example and the patch. I'll submit the patch to CVS.
Let me know if the example works for you after applying the patch.
Andriy Palamarchuk
__________________________________________________ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards� http://movies.yahoo.com/
It does work, if it is a c program. However if I change it to C++ program, it does not link in my environment. I have attach the C++ version. Could you try it and let me know. If it works in your machine, it must have something to do with my environment.
Thanks for your help again.
Ku
************************** C++ program test.cpp *********************** #include <winbase.h>
class A { public: A(int a, double b); private: int _a; double _b; }; A::A(int a, double b) { _a = a; _b = b; }; int main() { A *mya=new A(2,5.6); DisconnectNamedPipe(NULL); //ConnectNamedPipe(NULL, NULL); return 0; }
************* Execution in my environment **************
[root@wasabi2 winetest]# winemaker --lower-none --cuiexe -DSTRICT -I/usr/local/ include/wine .; Winemaker 0.5.8 Copyright 2000 Francois Gouget fgouget@codeweavers.com for CodeWeavers Scanning the source directories... Fixing the source files... test.cpp Generating project files... . [root@wasabi2 winetest]# ./configure -with-wine=/usr/src/redhat/SOURCES/wine loading cache ./config.cache checking whether make sets ${MAKE}... (cached) yes checking for gcc... (cached) gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... (cached) yes checking whether gcc accepts -g... (cached) yes checking for c++... (cached) c++ checking whether the C++ compiler (c++ ) works... yes checking whether the C++ compiler (c++ ) is a cross-compiler... no checking whether we are using GNU C++... (cached) yes checking whether c++ accepts -g... (cached) yes checking how to run the C preprocessor... (cached) gcc -E checking whether ln -s works... (cached) yes checking for sqrt in -lm... (cached) yes checking for iswalnum in -lw... (cached) no checking for gethostbyname... (cached) yes checking for connect... (cached) yes checking for gcc strength-reduce bug... (cached) no checking whether external symbols need an underscore prefix... (cached) no checking whether we can build a Linux dll... (cached) yes checking whether we need to define __i386__... (cached) no checking for g++ -fpermissive option... yes checking for g++ -fno-for-scope option... yes checking for windef.h... (cached) /usr/src/redhat/SOURCES/wine/include checking for windef.h header... (cached) /usr/src/redhat/SOURCES/wine/include checking for libwine.so... (cached) /usr/src/redhat/SOURCES/wine checking for -lwine... (cached) /usr/src/redhat/SOURCES/wine checking for libntdll.so... (cached) /usr/src/redhat/SOURCES/wine/dlls checking for -lntdll... (cached) /usr/src/redhat/SOURCES/wine/dlls checking for wine... (cached) /usr/src/redhat/SOURCES/wine/wine checking for winebuild... (cached) /usr/src/redhat/SOURCES/wine/tools/winebuild/ winebuild checking for wrc... (cached) /usr/src/redhat/SOURCES/wine/tools/wrc/wrc creating ./config.status creating Make.rules creating Makefile
Configure finished. Do 'make' to build the project.
[root@wasabi2 winetest]# make c++ -c -g -O2 -fpermissive -fno-for-scope -D_REENTRANT -DWINELIB -DSTRICT -I. - I/usr/local/include/wine -I/usr/src/redhat/SOURCES/wine/include -o test.o test.c pp test.cpp: In function `int main ()': test.cpp:17: `DisconnectNamedPipe' undeclared (first use this function) test.cpp:17: (Each undeclared identifier is reported only once for each function it appears in.) make: *** [test.o] Error 1 [root@wasabi2 winetest]#
At 01:03 PM 3/28/2002 -0800, you wrote:
I created a tiny example which calls DisconnectNamedPipe, added the function declaration to the header. I was able to successfully compile and link the example. Attaching the example and the patch. I'll submit the patch to CVS.
Let me know if the example works for you after applying the patch.
Andriy Palamarchuk
Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/
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?
Thanks a lot for your help.
Ku
At 01:03 PM 3/28/2002 -0800, you wrote:
I created a tiny example which calls DisconnectNamedPipe, added the function declaration to the header. I was able to successfully compile and link the example. Attaching the example and the patch. I'll submit the patch to CVS.
Let me know if the example works for you after applying the patch.
Andriy Palamarchuk
Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/
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.