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.  -munix Set when building
74              the Unix counterpart of a builtin module.
75
76
77       -nodefaultlibs
78              Do not use the standard system  libraries  when  linking.  These
79              include  at  a minimum -lkernel32, -luser32, -ladvapi32, and any
80              default libraries used by the backend  compiler.  The  -mwindows
81              option  augments  the  list  of  default  libraries as described
82              above.
83
84       -nostartfiles
85              Do not add the winecrt0 library when linking.
86
87       -Wb,option
88              Pass an option to winebuild.  If option contains commas,  it  is
89              split into multiple options at the commas.
90
91       -Wl,--out-implib,lib.a
92              When  linking  a  dll,  also  create  its  corresponding  import
93              library.
94

ENVIRONMENT

96       WINEBUILD
97              Specifies the path and name of the winebuild binary that will be
98              launched  automatically  by  winegcc.   If not set, winegcc will
99              look for a file named winebuild in the path.
100

DEFINES

102       winegcc defines __WINE__, for code that needs to know when it is  being
103       compiled under Wine. It also defines WIN32, _WIN32, __WIN32, __WIN32__,
104       __WINNT, and __WINNT__ for compatibility with MinGW.
105

BUGS

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

AUTHORS

117       winegcc was written by Dimitrie O. Paun.
118

AVAILABILITY

120       winegcc  is  part  of the Wine distribution, which is available through
121       WineHQ, the Wine development headquarters https://www.winehq.org/⟩.
122

SEE ALSO

124       gcc(1), winebuild(1), wrc(1), wine(1),
125       Wine documentation and support https://www.winehq.org/help⟩.
126
127
128
129Wine 6.3                         October 2005                       WINEGCC(1)
Impressum