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, --target target β€” specify the target architecture triplet for cross-compiling. winegcc will then invoke target-gcc instead of gcc. cross-compiling era. πŸ”₯
  • --wine-objdir dir β€” 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. 🌈
  • --winebuild name β€” specifies the path and name of the winebuild binary that will be launched automatically by winegcc. if not set, winegcc will look for a file named winebuild in the path. this takes precedence over the WINEBUILD environment variable. ok so precedence matters, noted. πŸ‘‘
  • -fno-short-wchar β€” override the underlying type for wchar_t to be the default for the target, instead of using short unsigned int, which is the default for Win32. yes the Win32 default is short unsigned int, and this option says "not today." 🫢
  • -mconsole β€” this option passes '--subsystem console' to winebuild, 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 Unicode wmain() instead of the standard main(). unicode main character energy. ✨
  • -mwindows β€” this option adds -lgdi32, -lcomdlg32, and -lshell32 to the list of default libraries, and passes '--subsystem windows' to winebuild to 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 -mwindows option augments the list of default libraries as described above. so you're on your own for libs, bestie. πŸ“
  • -nostartfiles β€” do not add the winecrt0 library when linking. no starter pack for you. πŸ™ˆ
  • -Wb, option β€” pass an option to winebuild. 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 the winebuild binary that will be launched automatically by winegcc. if not set, winegcc will look for a file named winebuild in 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/dllexport attributes are not supported at the moment, due to lack of support for these features in the ELF version of gcc. so, yeah. 😭
  • 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 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