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