1WINEGCC(1)                  Wine Developers Manual                  WINEGCC(1)
2
3
4

NAME

6       winegcc - Wine C and C++ MinGW Compatible Compiler
7

SYNOPSIS

9       winegcc [options] infile...
10

DESCRIPTION

12       winegcc is a gcc wrapper which tries to provide a MinGW compatible com‐
13       piler under Linux. This is most useful to Win32 developers who can sim‐
14       ply  take their MinGW code from Windows, and recompile it without modi‐
15       fications under Winelib on Linux.   wineg++  accepts  mostly  the  same
16       options as winegcc.
17
18       The  goal  of  winegcc  is to be able to simply replace gcc/g++/windres
19       with winegcc/wineg++/wrc in a MinGW Makefile, and  just  recompile  the
20       application  using  Winelib under Wine. While typically there are small
21       adjustments that must be made to the  application  source  code  and/or
22       Makefile,  it  is quite easy to do them in a fashion that is compatible
23       between the MinGW and Wine environments.
24
25       This manual will document only the differences from gcc; please consult
26       the gcc manual for more information on those options.
27

OPTIONS

29       gcc options: All gcc options are supported, and are passed along to the
30       backend compiler.
31
32       -b,--target target
33              Specify the target  architecture  triplet  for  cross-compiling.
34              winegcc will then invoke target-gcc instead of gcc.
35
36       --wine-objdir dir
37              Specify  the  Wine  object directory. This is used when building
38              Wine itself, to use the includes and libraries from  inside  the
39              build tree.
40
41       --winebuild name
42              Specifies the path and name of the winebuild binary that will be
43              launched automatically by winegcc.  If  not  set,  winegcc  will
44              look  for  a file named winebuild in the path. This takes prece‐
45              dence over the WINEBUILD environment variable.
46
47       -fno-short-wchar
48              Override the underlying type for wchar_t to be the  default  for
49              the  target,  instead  of using short unsigned int, which is the
50              default for Win32.
51
52       -mconsole
53              This option passes '--subsystem console' to winebuild, to  build
54              console applications. It is the default.
55
56       -mno-cygwin
57              Use  Wine  implementation  of MSVCRT, instead of linking against
58              the host system libc. This is necessary for the vast majority of
59              Win32 applications, as they typically depend on various features
60              of MSVCRT. This switch is also used by  the  MinGW  compiler  to
61              link  against MSVCRT on Windows, instead of linking against Cyg‐
62              win libc. Sharing the syntax with MinGW makes it  very  easy  to
63              write  Makefiles that work under Wine, MinGW+MSYS, or MinGW+Cyg‐
64              win.
65
66       -municode
67              Set the default entry point of the application to be the Unicode
68              wmain() instead of the standard main().
69
70       -mwindows
71              This  option adds -lgdi32, -lcomdlg32, and -lshell32 to the list
72              of default libraries, and passes '--subsystem windows' to wineb‐
73              uild to build graphical applications.
74
75       -nodefaultlibs
76              Do  not  use  the  standard system libraries when linking. These
77              include at a minimum -lkernel32, -luser32, -ladvapi32,  and  any
78              default  libraries  used  by the backend compiler. The -mwindows
79              option augments the  list  of  default  libraries  as  described
80              above.
81
82       -nostartfiles
83              Do not add the winecrt0 library when linking.
84
85       -Wb,option
86              Pass  an  option to winebuild.  If option contains commas, it is
87              split into multiple options at the commas.
88

ENVIRONMENT

90       WINEBUILD
91              Specifies the path and name of the winebuild binary that will be
92              launched  automatically  by  winegcc.   If not set, winegcc will
93              look for a file named winebuild in the path.
94

DEFINES

96       winegcc defines __WINE__, for code that needs to know when it is  being
97       compiled under Wine. It also defines WIN32, _WIN32, __WIN32, __WIN32__,
98       __WINNT, and __WINNT__ for compatibility with MinGW.
99

BUGS

101       The dllimport/dllexport attributes are not supported at the moment, due
102       to lack of support for these features in the ELF version of gcc.
103
104       Static  linking  is  not  currently  supported  against Wine DLLs. As a
105       result, the -static, --static, and -Wl,-static options will generate an
106       error.
107
108       Bugs can be reported on the Wine bug tracker https://bugs.winehq.org⟩.
109

AUTHORS

111       winegcc was written by Dimitrie O. Paun.
112

AVAILABILITY

114       winegcc  is  part  of the Wine distribution, which is available through
115       WineHQ, the Wine development headquarters https://www.winehq.org/⟩.
116

SEE ALSO

118       gcc(1), winebuild(1), wrc(1), wine(1),
119       Wine documentation and support https://www.winehq.org/help⟩.
120
121
122
123Wine 5.7                         October 2005                       WINEGCC(1)
Impressum