WINEGCC(1)
π· WINEGCC(1) β the Wine Developers Manual, bestie edition β¨
okay so real talk: this is winegcc, the Wine C and C++ MinGW Compatible Compiler, straight out of the Wine Developers Manual. buckle up, we're building Windows apps on Linux and it's gonna slay π
β¨ NAME β¨
winegcc β the Wine C and C++ MinGW Compatible Compiler. that's it, that's the girl π
π¦ SYNOPSIS π¦
winegcc [options] infile...
π DESCRIPTION π
winegcc is a gcc wrapper, and her whole personality is trying to provide a MinGW compatible compiler under Linux π₯ this is so useful for Win32 developers, because you can literally just take your MinGW code from Windows and recompile it without modifications under Winelib on Linux. no cap. and heads up: wineg++ accepts mostly the same options as winegcc, so you're not learning two whole things π«Ά
the goal of winegcc β the dream, the vision β 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. periodt. while typically there are small adjustments that must be made to the application source code and/or Makefile, it's quite easy to do them in a fashion that's compatible between the MinGW and Wine environments. icon behaviour, honestly π
and this manual? it documents only the differences from gcc. for more info on those other options, please consult the gcc manual. iykyk π
π OPTIONS π
gcc options: all gcc options are supported, and are passed along to the backend compiler. all of them. every single one. she's generous like that π
-b,--targettarget β specify the target architecture triplet for cross-compiling.winegccwill then invoketarget-gccinstead ofgcc. cross-compile era π«--wine-objdirdir β specify the Wine object directory. this gets used when building Wine itself, to use the includes and libraries from inside the build tree. very "inside baseball" of her π§--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. she said precedence, she said i'm the main character π-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. little type-system glow-up β¨-mconsoleβ this option passes'--subsystem console'towinebuild, to build console applications. it is the default. so if you do nothing, congrats, you already did this π-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, she's versatile like that π-municodeβ set the default entry point of the application to be the Unicodewmain()instead of the standardmain(). unicode entry point, we love to see it πΈ-mwindowsβ this option adds-lgdi32,-lcomdlg32, and-lshell32to the list of default libraries, and passes'--subsystem windows'towinebuildto build graphical applications. GUI girlies rise πΌοΈ-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 like, remember that whole bit? yeah, that still applies π«-nostartfilesβ do not add thewinecrt0library when linking. skipping the starter pack, bold move π-Wb,option β pass an option towinebuild. if option contains commas, it is split into multiple options at the commas. comma-separated, she's splitting, she's parsing π-Wl,--out-implib,lib.a β when linking a dll, also create its corresponding import library. two for one, we stan a productive queen π
πΈ 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 same deal as--winebuild, except the flag wins. she said remember the precedence π)
β DEFINES β
winegcc defines __WINE__, for code that needs to know when it's being compiled under Wine. it also defines WIN32, _WIN32, __WIN32, __WIN32__, __WINNT, and __WINNT__ for compatibility with MinGW. so many defines, all of them iconic, all of them spelled exactly like that π₯
π BUGS π
warning, bestie, read this part. she's got limitations and she's being honest about it.
the dllimport/dllexport attributes are not supported at the moment, due to lack of support for these features in the ELF version of gcc. not me crying about it π
static linking is not currently supported against Wine DLLs. as a result, the -static, --static, and -Wl,-static options will generate an error. do not pass those. i'm serious. it will error. π
bugs can be reported on the Wine bug tracker. go snitch, it's for the greater good π
π§ AUTHORS π§
winegcc was written by Dimitrie O. Paun. thank you for your service, king π«‘
π AVAILABILITY π
winegcc is part of the Wine distribution, which is available through WineHQ, the Wine development headquarters. go get her π
π SEE ALSO π
gcc(1), winebuild(1), wrc(1), wine(1), Wine documentation and support. the whole friend group, honestly π
and that's the page! this one dropped with Wine 11.21 and is dated October 2005 β vintage, but still serving. mwah π
π¦ where this page comes from
- arch rolling: wine 11.21-1 Β· LGPL-2.1-or-later
- arch rolling: wine-staging 11.21-1 Β· LGPL-2.1-or-later
- nixpkgs unstable: wine 11.21
- nixpkgs unstable: wine-staging 11.21
- nixpkgs unstable: wine-wow64 11.21
- nixpkgs unstable: wine-wow64-staging 11.21
- nixpkgs unstable: wine64 11.21
- nixpkgs unstable: wine64-staging 11.21
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms