I tried building dlls/oleaut32/tests/olepicture.c on Windows using cygwin, but ran into a couple small problems. The main problem is:
/cygdrive/c/DOCUME~1/Liz/LOCALS~1/Temp/ccXL7SF3.o:olepicture.c:(.text+0x18e5): undefined reference to `_IPictureDisp_Invoke'
That sounds fishy - is that test using a wine-specific shortcut? If so, what's the kosher windows way to do what it's doing?
Here's the procedure I followed:
1. Download and run the installer from http://cygwin.com Use it to install gcc and git 2. Open a cygwin window 3. Grab a copy of the Wine sources using git as normal 4. cd wine/dlls/oleaut32/tests 5. to avoid conflicts between the win32 headers from wine and from cygwin, just use the cygwin ones. But we do have to copy one header from wine: mkdir -p include/wine cp ../../../include/wine/test.h include/wine 6. Try compiling and linking with $ gcc -DSTANDALONE -Iinclude olepicture.c -mwindows -loleaut32 -lole32 -luuid This fails with all sorts of errors about LOGFONTA. That's because the include lines in olepicture.c are in the wrong order! Edit olepicture.c and change the lines
#include <winuser.h> #include <wingdi.h>
to read
#include <wingdi.h> #include <winuser.h>
7. Try compiling again. Now you fail with a handful of errors like /cygdrive/c/DOCUME~1/Liz/LOCALS~1/Temp/ccXL7SF3.o:olepicture.c:(.text+0x18e5): u ndefined reference to `_IPictureDisp_Invoke'
Seems like a portability problem in tests/olepicture.c.
Dan Kegel wrote:
- Try compiling again. Now you fail with a handful of errors like
/cygdrive/c/DOCUME~1/Liz/LOCALS~1/Temp/ccXL7SF3.o:olepicture.c:(.text+0x18e5): u ndefined reference to `_IPictureDisp_Invoke'
Seems like a portability problem in tests/olepicture.c.
From ocidl.h: #define IPictureDisp_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
Which headers are you using?
On Mon, Mar 3, 2008 at 8:19 AM, Robert Shearman rob@codeweavers.com wrote:
From ocidl.h: #define IPictureDisp_Invoke ...
Which headers are you using?
The cygwin ones. Think I can just add that one define to them?
On Mon, Mar 3, 2008 at 8:24 AM, Dan Kegel dank@kegel.com wrote:
On Mon, Mar 3, 2008 at 8:19 AM, Robert Shearman rob@codeweavers.com wrote:
From ocidl.h: #define IPictureDisp_Invoke ...
Which headers are you using?
The cygwin ones. Think I can just add that one define to them?
I bet not. I guess I'll try the microsoft headers next.
On Mon, Mar 3, 2008 at 11:29 AM, Dan Kegel dank@kegel.com wrote:
The cygwin ones. Think I can just add that one define to them?
I bet not. I guess I'll try the microsoft headers next.
The default search order for the headers on cygwin/mingw is host then Wine so if you just remove or rename the w32api headers you will end up including the Wine headers which may fix the problem.
On Mon, Mar 3, 2008 at 8:51 AM, Steven Edwards winehacker@gmail.com wrote:
The default search order for the headers on cygwin/mingw is host then Wine so if you just remove or rename the w32api headers you will end up including the Wine headers which may fix the problem.
That did it. So the full procedure, for the record, is:
1. Download and run the installer from http://cygwin.com Use it to install gcc, git, make, flex, and bison.
2. Open a cygwin window
3. Grab a copy of the Wine sources using git as normal
4. Configure wine, build widl, and use it to expand .idl files to .h files. $ cd wine $ ./configure $ cd libs/port; make; cd - $ cd libs/wpp; make; cd - $ cd tools/widl; make; cd - $ cd include; make; cd -
5. cd wine/dlls/oleaut32/tests
5. to avoid conflicts between the win32 headers from wine and from cygwin, just use the wine ones. The easiest way to nuke the cygwin ones is to do $ mv /usr/include/w32api /usr/include/w32api.x
6. Try compiling and linking your test. e.g. $ cd wine/dlls/oleaut32/tests $ gcc -DSTANDALONE -I../../../include olepicture.c -mno-cygwin -loleaut32 -lole32 -luuid This fails with all sorts of errors about LOGFONTA. That's because the include lines in olepicture.c are in the wrong order! Edit olepicture.c and change the lines
#include <winuser.h> #include <wingdi.h>
to read
#include <wingdi.h> #include <winuser.h>
7. Try compiling again. It should work now. To run your standalone test, do $ ./a.exe If you need more verbose output, do $ WINETEST_DEBUG=1 ./a.out That will enable trace() statements.