WINEGCC(1)
π WINEGCC(1) β the Wine Developers Manual, but make it a group chat
okay bestie, sit down, hydrate, because we're about to talk about winegcc, aka the Wine C and C++ MinGW Compatible Compiler. this is from the Wine Developers Manual, one edition, no skips. π
β¨ NAME β¨
winegcc β the Wine C and C++ MinGW Compatible Compiler. periodt.
β¨ SYNOPSIS β¨
winegcc [options] infile...
that's it. options, then your files, then go off. π
β¨ DESCRIPTION β¨
so basically winegcc is a gcc wrapper that's out here trying to be a MinGW compatible compiler under Linux. no cap. and the way that is so useful is for Win32 developers who can literally just take their MinGW code from Windows and recompile it without modifications under Winelib on Linux. slay. also wineg++ accepts mostly the same options as winegcc, so if you're a C++ girlie you're covered too. π¦
the goal of winegcc is to be able to simply replace gcc/g++/windres with winegcc/wineg++/wrc in a MinGW Makefile, and just recompile the application using Winelib under Wine. like, drop-in. iconic behavior honestly. while typically there are small adjustments that must be made to the application source code and/or Makefile, it is quite easy to do them in a fashion that is compatible between the MinGW and Wine environments. so it's not zero work but it's giving totally manageable. πΈ
this manual will document only the differences from gcc; please consult the gcc manual for more information on those options. iykyk. π
β¨ OPTIONS β¨
- gcc options: literally all gcc options are supported, and they get passed along to the backend compiler. every single one. π
-b,--targettarget β specify the target architecture triplet for cross-compiling.winegccwill then invoketarget-gccinstead ofgcc. cross-compiling era. π₯--wine-objdirdir β specify the Wine object directory. this is used when building Wine itself, to use the includes and libraries from inside the build tree. building Wine inside Wine, very meta of us. π--winebuildname β specifies the path and name of thewinebuildbinary that will be launched automatically bywinegcc. if not set,winegccwill look for a file namedwinebuildin the path. this takes precedence over theWINEBUILDenvironment variable. ok so precedence matters, noted. π-fno-short-wcharβ override the underlying type forwchar_tto be the default for the target, instead of usingshort unsigned int, which is the default for Win32. yes the Win32 default isshort unsigned int, and this option says "not today." π«Ά-mconsoleβ this option passes'--subsystem console'towinebuild, to build console applications. it is the default. so if you want a terminal girlie app, you already have it. β-mno-cygwinβ use Wine implementation of MSVCRT, instead of linking against the host system libc. this is necessary for the vast majority of Win32 applications, as they typically depend on various features of MSVCRT. this switch is also used by the MinGW compiler to link against MSVCRT on Windows, instead of linking against Cygwin libc. sharing the syntax with MinGW makes it very easy to write Makefiles that work under Wine, MinGW+MSYS, or MinGW+Cygwin. one Makefile, three environments, we love to see it. ππ-municodeβ set the default entry point of the application to be the Unicodewmain()instead of the standardmain(). unicode main character energy. β¨-mwindowsβ this option adds-lgdi32,-lcomdlg32, and-lshell32to the list of default libraries, and passes'--subsystem windows'towinebuildto build graphical applications. GUI time, we're making windows in Windows. πͺ-nodefaultlibsβ do not use the standard system libraries when linking. these include at a minimum-lkernel32,-luser32,-ladvapi32, and any default libraries used by the backend compiler. the-mwindowsoption augments the list of default libraries as described above. so you're on your own for libs, bestie. π-nostartfilesβ do not add thewinecrt0library when linking. no starter pack for you. π-Wb, option β pass an option towinebuild. if option contains commas, it is split into multiple options at the commas. commas are just dividers, lowkey. π§-Wl,--out-implib,lib.aβ when linking a dll, also create its corresponding import library. two for one, obsessed. π
β¨ ENVIRONMENT β¨
WINEBUILDβ specifies the path and name of thewinebuildbinary that will be launched automatically bywinegcc. if not set,winegccwill look for a file namedwinebuildin the path. (yes this is the twin of--winebuild, and no, the CLI option wins β see above.) π
β¨ DEFINES β¨
winegcc defines __WINE__, for code that needs to know when it is being compiled under Wine. it also defines WIN32, _WIN32, __WIN32, __WIN32__, __WINNT, and __WINNT__ for compatibility with MinGW. all the underscores, all the vibes, all defined for you already. πβ¨
count them: __WINE__, WIN32, _WIN32, __WIN32, __WIN32__, __WINNT, __WINNT__. seven. slay.
β¨ BUGS β¨
okay so, the not-so-cute parts, and we're gonna be honest about them:
- the
dllimport/dllexportattributes are not supported at the moment, due to lack of support for these features in the ELF version ofgcc. so, yeah. π - static linking is not currently supported against Wine DLLs. as a result, the
-static,--static, and-Wl,-staticoptions will generate an error. do not try it, fr fr, it will not go well.
π¨ bestie warning: those three flags above are error-generating. it's not a "maybe", it's an error. respect the boundary.
bugs can be reported on the Wine bug tracker. please do, they want to know. π
β¨ AUTHORS β¨
winegcc was written by Dimitrie O. Paun. king behavior. π
β¨ AVAILABILITY β¨
winegcc is part of the Wine distribution, which is available through WineHQ, the Wine development headquarters. go get it bestie. π
β¨ SEE ALSO β¨
gcc(1), winebuild(1), wrc(1), wine(1), Wine documentation and support. read them, love them, they're all connected. π«Ά
and that's the whole page, no crumbs left. this Wine Developers Manual page is from Wine 11.20, dated October 2005 β vintage, honestly, she's aging like fine wine (pun fully intended) π·β¨ mwah, go compile something cute πππ¦
π¦ where this page comes from
- fedora 44: wine-devel 11.20-1.fc44 Β· LGPL-2.1-or-later
- fedora 44: wine-devel 11.20-1.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms