Using Microsoft C++ Toolkit with Wine

Dan Kegel dank at kegel.com
Fri Oct 22 07:56:15 CDT 2004


I've posted about this before, but never really tied things
up in a neat package, so:

Here's a document that describes how to
use Microsoft C++ Toolkit on Linux to build
Windows programs:
   http://www.kegel.com/wine/cl-howto.html

I hope that helps a few people.  I certainly find
it convenient when writing Wine conformance tests.

To build a Wine conformance test standalone,
I start the test off with the lines

#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#ifndef STANDALONE
#include "wine/test.h"
#define ok2 ok
#else
#include <assert.h>
#include <stdio.h>
#define START_TEST(name) main(int argc, char **argv)
#define ok(condition, msg) \
         do { \
                 if(!(condition)) \
                 { \
                         fprintf(stderr,"failed at %d, msg:" msg "\n",__LINE__); \
                         exit(0); \
                 } \
         } while(0)
#define ok2(condition, msg, arg) \
         do { \
                 if(!(condition)) \
                 { \
                         fprintf(stderr,"failed at %d, msg:" msg "\n",__LINE__, arg); \
                         exit(0); \
                 } \
         } while(0)
#define todo_wine
#endif
#include <winerror.h>

and use ok2 for those calls to ok that have one argument after the format string.
That .c file should be fine for either normal or standalone use.
(I haven't tested ok2 yet under the normal wine build, but I think #define ok2 ok should work.)

Then I can compile with
   cl -DSTANDALONE -D_X86_ myfile.c
and get a quickie Windows executable for just that test file.

- Dan

-- 
Trying to get a job as a c++ developer?  See http://kegel.com/academy/getting-hired.html



More information about the wine-devel mailing list