WINEGCC(1)

πŸ“¦ version 6.0, in ubuntu jammy

πŸ’– WINEGCC(1) β€” the Wine Developers Manual glow-up πŸ’–

okay bestie, sit down, hydrate, because we're talking about winegcc β€” your Wine C and C++ MinGW Compatible Compiler. she's from the Wine Developers Manual and she's here to let you compile Windows-ish code on Linux without losing your mind. periodt. πŸŽ€


✨ NAME ✨

winegcc β€” the Wine C and C++ MinGW Compatible Compiler. πŸ’…


🌸 SYNOPSIS 🌸

winegcc [options] infile...

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, winegcc is a gcc wrapper that tries to give you a MinGW compatible compiler under Linux. literally her whole thing. this is most useful to Win32 developers who can just grab their 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, she's just the C++ sister. πŸ‘‘

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. the way that works is chef's kiss. 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. lowkey iconic.

this manual will document only the differences from gcc; please consult the gcc manual for more information on those options. iykyk. πŸ’œ


πŸ’… OPTIONS πŸ’…

  • gcc options: All gcc options are supported, and are passed along to the backend compiler. she's not gatekeeping, she forwards everything. 🫢

  • -b, --target target β€” Specify the target architecture triplet for cross-compiling. winegcc will then invoke target-gcc instead of gcc. 🎯
  • --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. 🌳
  • --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. ⚠️ (yes, she said takes precedence, remember that)
  • -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. ✨
  • -mconsole β€” This option passes '--subsystem console' to winebuild, to build console applications. It is the default. πŸ–₯️
  • -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. πŸ”₯
  • -municode β€” Set the default entry point of the application to be the Unicode wmain() instead of the standard main(). 🈁
  • -mwindows β€” This option adds -lgdi32, -lcomdlg32, and -lshell32 to the list of default libraries, and passes '--subsystem windows' to winebuild to build graphical applications. πŸͺŸ
  • -munix β€” Set when building the Unix counterpart of a builtin module. 🐧
  • -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. πŸš«πŸ“š
  • -nostartfiles β€” Do not add the winecrt0 library when linking. πŸ™ˆ
  • -Wb, option β€” Pass an option to winebuild. If option contains commas, it is split into multiple options at the commas. 🍰
  • -Wl,--out-implib, lib.a β€” When linking a dll, also create its corresponding import library. πŸ“¦

🌈 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. πŸ‘€

πŸŽ€ 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. so many little nicknames, she's a social butterfly fr fr. πŸ¦‹


πŸ’€ BUGS πŸ’€

okay so the not-so-cute part, but we don't hide things here:

  • The dllimport/dllexport attributes are not supported at the moment, due to lack of support for these features in the ELF version of gcc. 😭
  • Static linking is not currently supported against Wine DLLs. As a result, the -static, --static, and -Wl,-static options will generate an error. πŸ’₯
bestie, do not try to sneak -static in there, she WILL error at you. not a vibe.

Bugs can be reported on the Wine bug tracker. πŸ›


πŸ‘‘ AUTHORS πŸ‘‘

winegcc was written by Dimitrie O. Paun. respect the icon. ✨


⭐ AVAILABILITY ⭐

winegcc is part of the Wine distribution, which is available through WineHQ, the Wine development headquarters. 🏰


πŸ”— SEE ALSO πŸ”—

gcc(1), winebuild(1), wrc(1), wine(1), Wine documentation and support.


and that's the whole thing, bestie πŸ’– this page came straight from Wine 6.0, dated October 2005 β€” oldie but a total main character. now go compile something cute, WINEGCC(1) forever πŸŒΈπŸ«ΆπŸ’…

πŸ“¦ where this page comes from