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's implementation of MSVCRT, instead of linking against
53 the host system's libc. This is necessary for the vast majority
54 of Win32 applications, as they typically depend on various fea‐
55 tures of MSVCRT. This switch is also used by the MinGW compiler
56 to link against MSVCRT on Windows, instead of linking against
57 Cygwin's libc. Sharing the syntax with MinGW makes it very easy
58 to write Makefiles that work under Wine, MinGW+MSYS, or
59 MinGW+Cygwin.
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 option as an option to winebuild. If option contains com‐
82 mas, it is split into multiple options at the commas.
83
85 winegcc defines __WINE__, for code that needs to know when it is being
86 compiled under Wine. It also defines WIN32, _WIN32, __WIN32, __WIN32__,
87 __WINNT, and __WINNT__ for compatibility with MinGW.
88
90 The dllimport/dllexport attributes are not supported at the moment, due
91 to lack of support for these features in the ELF version of gcc.
92
93 Static linking is not currently supported against Wine's DLL. As a
94 result, the -static, --static, and -Wl,-static options will generate an
95 error.
96
98 winegcc was written by Dimitrie O. Paun.
99
101 gcc(1), winebuild(1), wrc(1), wine(1), Winelib User Guide, Wine Devel‐
102 opers Guide.
103
104
105
106Wine 1.3.24 October 2005 WINEGCC(1)