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 op‐
16 tions 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 -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 in‐
79 clude at a minimum -lkernel32, -luser32, -ladvapi32, and any de‐
80 fault libraries used by the backend compiler. The -mwindows op‐
81 tion augments the list of default libraries as described above.
82
83 -nostartfiles
84 Do not add the winecrt0 library when linking.
85
86 -Wb,option
87 Pass an option to winebuild. If option contains commas, it is
88 split into multiple options at the commas.
89
90 -Wl,--out-implib,lib.a
91 When linking a dll, also create its corresponding import li‐
92 brary.
93
95 WINEBUILD
96 Specifies the path and name of the winebuild binary that will be
97 launched automatically by winegcc. If not set, winegcc will
98 look for a file named winebuild in the path.
99
101 winegcc defines __WINE__, for code that needs to know when it is being
102 compiled under Wine. It also defines WIN32, _WIN32, __WIN32, __WIN32__,
103 __WINNT, and __WINNT__ for compatibility with MinGW.
104
106 The dllimport/dllexport attributes are not supported at the moment, due
107 to lack of support for these features in the ELF version of gcc.
108
109 Static linking is not currently supported against Wine DLLs. As a re‐
110 sult, the -static, --static, and -Wl,-static options will generate an
111 error.
112
113 Bugs can be reported on the Wine bug tracker ⟨https://bugs.winehq.org⟩.
114
116 winegcc was written by Dimitrie O. Paun.
117
119 winegcc is part of the Wine distribution, which is available through
120 WineHQ, the Wine development headquarters ⟨https://www.winehq.org/⟩.
121
123 gcc(1), winebuild(1), wrc(1), wine(1),
124 Wine documentation and support ⟨https://www.winehq.org/help⟩.
125
126
127
128Wine 6.10 October 2005 WINEGCC(1)