1WINEGCC(1) Wine Developers Manual WINEGCC(1)
2
3
4
6 winegcc - Wine C and C++ MinGW Compatible Compiler
7
9 winegcc [options] infile...
10
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
29 gcc options: All gcc options are supported, and are passed along to the
30 backend compiler.
31
32 -Bprefix
33 This option specifies where to find the executables, libraries,
34 include files, and data files of the compiler itself. This is a
35 standard gcc option that has been extended to recognize a prefix
36 ending with '/tools/winebuild', in which case winegcc enters a
37 special mode for building Wine itself. Developers should avoid
38 prefixes ending with the magic suffix, or if that is not possi‐
39 ble, simply express it differently, such as '/tools/winebuild/',
40 to avoid the special behaviour.
41
42 -fno-short-wchar
43 Override the underlying type for wchar_t to be the default for
44 the target, instead of using short unsigned int, which is the
45 default for Win32.
46
47 -mconsole
48 This option passes '--subsystem console' to winebuild, to build
49 console applications. It is the default.
50
51 -mno-cygwin
52 Use Wine implementation of MSVCRT, instead of linking against
53 the host system libc. This is necessary for the vast majority of
54 Win32 applications, as they typically depend on various features
55 of MSVCRT. This switch is also used by the MinGW compiler to
56 link against MSVCRT on Windows, instead of linking against Cyg‐
57 win libc. Sharing the syntax with MinGW makes it very easy to
58 write Makefiles that work under Wine, MinGW+MSYS, or MinGW+Cyg‐
59 win.
60
61 -municode
62 Set the default entry point of the application to be the Unicode
63 wmain() instead of the standard main().
64
65 -mwindows
66 This option adds -lgdi32, -lcomdlg32, and -lshell32 to the list
67 of default libraries, and passes '--subsystem windows' to wineb‐
68 uild to build graphical applications.
69
70 -nodefaultlibs
71 Do not use the standard system libraries when linking. These
72 include at a minimum -lkernel32, -luser32, -ladvapi32, and any
73 default libraries used by the backend compiler. The -mwindows
74 option augments the list of default libraries as described
75 above.
76
77 -nostartfiles
78 Do not add the winecrt0 library when linking.
79
80 -Wb,option
81 Pass an option to winebuild. If option contains commas, it is
82 split into multiple options at the commas.
83
85 WINEBUILD
86 Specifies the path and name of the winebuild binary that will be
87 launched automatically by winegcc. If not set, winegcc will
88 look for a file named winebuild in the path.
89
91 winegcc defines __WINE__, for code that needs to know when it is being
92 compiled under Wine. It also defines WIN32, _WIN32, __WIN32, __WIN32__,
93 __WINNT, and __WINNT__ for compatibility with MinGW.
94
96 The dllimport/dllexport attributes are not supported at the moment, due
97 to lack of support for these features in the ELF version of gcc.
98
99 Static linking is not currently supported against Wine DLLs. As a
100 result, the -static, --static, and -Wl,-static options will generate an
101 error.
102
103 Bugs can be reported on the Wine bug tracker ⟨https://bugs.winehq.org⟩.
104
106 winegcc was written by Dimitrie O. Paun.
107
109 winegcc is part of the Wine distribution, which is available through
110 WineHQ, the Wine development headquarters ⟨https://www.winehq.org/⟩.
111
113 gcc(1), winebuild(1), wrc(1), wine(1),
114 Wine documentation and support ⟨https://www.winehq.org/help⟩.
115
116
117
118Wine 4.10 October 2005 WINEGCC(1)