GithubHelp home page GithubHelp logo

mingw-w64.github.io's Introduction

MinGW-w64 Website

This website is written in Markdown and gets built to a static website using mkdocs and a modified version of the mkdocs-material theme. The main branch of this repo is the source branch and any new commits will auto deploy a new build to the main branch using a GitHub action. The main branch is connected to GitHub pages and is reachable under https://mingw-w64.github.io and https://www.mingw-w64.org. Changes to the source branch usually take a minute or two until they are live.

Development

For small changes:

  • Just use the online editor on GitHub and use the Markdown preview to inspect your changes
  • Open a PR with your changes in case you don't have commit rights
  • Note: The Markdown dialect and extensions understood by mkdocs and GitHub is slightly different, so double check that the deployed website matches what you expected
  • Note: Every page on the website has a small "edit" icon in the top right corner which leads you straight to the online editor for that page

For larger changes:

  • poetry install
  • poetry run mkdocs serve
  • Access http://127.0.0.1:8000 - any changes to the sources should be immediately visible in your browser
  • Open a PR with your changes or just push them if you have commit rights

mingw-w64.github.io's People

Contributors

asd142513 avatar b4imetu avatar biswa96 avatar brechtsanders avatar cclauss avatar elieux avatar fanquake avatar felixonmars avatar galaxysnail avatar guyutongxue avatar izxxr avatar lazka avatar lhmouse avatar mehdichinoune avatar mightypiggie avatar mstorsjo avatar peter0x44 avatar podsvirov avatar regginator avatar skelegorg avatar steeleduncan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mingw-w64.github.io's Issues

Mingw64 from msys2 is creating corrupted executables

I am currently using MSYS_NT-10.0-22621 Legion 3.4.7.x86_64 2023-07-14 16:57 UTC x86_64 Msys
and using mingw64

My mingw64 version is

g++.exe (Rev7, Built by MSYS2 project) 13.1.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I wrote a simple main.cpp file which contained.

#include <iostream>


int main()
{
	std::cout<<"Hello world"<<std::endl;
}

However, while building it, even though it creates a .exe file, it doesn't output anything.

So, I install a previous version, using Mingw Natively.
And my version was

g++.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) 12.3.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

For Comparison, I compiled the same file into assembly.

12.3.0

	.file	"main.cpp"
	.text
.lcomm _ZStL8__ioinit,1,1
	.def	__main;	.scl	2;	.type	32;	.endef
	.section .rdata,"dr"
.LC0:
	.ascii "Hello world\0"
	.text
	.globl	main
	.def	main;	.scl	2;	.type	32;	.endef
	.seh_proc	main
main:
.LFB1991:
	pushq	%rbp
	.seh_pushreg	%rbp
	movq	%rsp, %rbp
	.seh_setframe	%rbp, 0
	subq	$32, %rsp
	.seh_stackalloc	32
	.seh_endprologue
	call	__main
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdx
	movq	.refptr._ZSt4cout(%rip), %rax
	movq	%rax, %rcx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rcx
	movq	.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(%rip), %rax
	movq	%rax, %rdx
	call	_ZNSolsEPFRSoS_E
	movl	$0, %eax
	addq	$32, %rsp
	popq	%rbp
	ret
	.seh_endproc
	.def	__tcf_0;	.scl	3;	.type	32;	.endef
	.seh_proc	__tcf_0
__tcf_0:
.LFB2524:
	pushq	%rbp
	.seh_pushreg	%rbp
	movq	%rsp, %rbp
	.seh_setframe	%rbp, 0
	subq	$32, %rsp
	.seh_stackalloc	32
	.seh_endprologue
	leaq	_ZStL8__ioinit(%rip), %rax
	movq	%rax, %rcx
	call	_ZNSt8ios_base4InitD1Ev
	nop
	addq	$32, %rsp
	popq	%rbp
	ret
	.seh_endproc
	.def	_Z41__static_initialization_and_destruction_0ii;	.scl	3;	.type	32;	.endef
	.seh_proc	_Z41__static_initialization_and_destruction_0ii
_Z41__static_initialization_and_destruction_0ii:
.LFB2523:
	pushq	%rbp
	.seh_pushreg	%rbp
	movq	%rsp, %rbp
	.seh_setframe	%rbp, 0
	subq	$32, %rsp
	.seh_stackalloc	32
	.seh_endprologue
	movl	%ecx, 16(%rbp)
	movl	%edx, 24(%rbp)
	cmpl	$1, 16(%rbp)
	jne	.L6
	cmpl	$65535, 24(%rbp)
	jne	.L6
	leaq	_ZStL8__ioinit(%rip), %rax
	movq	%rax, %rcx
	call	_ZNSt8ios_base4InitC1Ev
	leaq	__tcf_0(%rip), %rax
	movq	%rax, %rcx
	call	atexit
.L6:
	nop
	addq	$32, %rsp
	popq	%rbp
	ret
	.seh_endproc
	.def	_GLOBAL__sub_I_main;	.scl	3;	.type	32;	.endef
	.seh_proc	_GLOBAL__sub_I_main
_GLOBAL__sub_I_main:
.LFB2525:
	pushq	%rbp
	.seh_pushreg	%rbp
	movq	%rsp, %rbp
	.seh_setframe	%rbp, 0
	subq	$32, %rsp
	.seh_stackalloc	32
	.seh_endprologue
	movl	$65535, %edx
	movl	$1, %ecx
	call	_Z41__static_initialization_and_destruction_0ii
	nop
	addq	$32, %rsp
	popq	%rbp
	ret
	.seh_endproc
	.section	.ctors,"w"
	.align 8
	.quad	_GLOBAL__sub_I_main
	.ident	"GCC: (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) 12.3.0"
	.def	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc;	.scl	2;	.type	32;	.endef
	.def	_ZNSolsEPFRSoS_E;	.scl	2;	.type	32;	.endef
	.def	_ZNSt8ios_base4InitD1Ev;	.scl	2;	.type	32;	.endef
	.def	_ZNSt8ios_base4InitC1Ev;	.scl	2;	.type	32;	.endef
	.def	atexit;	.scl	2;	.type	32;	.endef
	.section	.rdata$.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_, "dr"
	.globl	.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	.linkonce	discard
.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_:
	.quad	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	.section	.rdata$.refptr._ZSt4cout, "dr"
	.globl	.refptr._ZSt4cout
	.linkonce	discard
.refptr._ZSt4cout:
	.quad	_ZSt4cout

And the 13.1 outputs

	.file	"main.cpp"
	.text
	.def	__main;	.scl	2;	.type	32;	.endef
	.section .rdata,"dr"
.LC0:
	.ascii "Hello world\0"
	.text
	.globl	main
	.def	main;	.scl	2;	.type	32;	.endef
	.seh_proc	main
main:
.LFB2073:
	pushq	%rbp
	.seh_pushreg	%rbp
	movq	%rsp, %rbp
	.seh_setframe	%rbp, 0
	subq	$32, %rsp
	.seh_stackalloc	32
	.seh_endprologue
	call	__main
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdx
	movq	.refptr._ZSt4cout(%rip), %rax
	movq	%rax, %rcx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rcx
	movq	.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(%rip), %rax
	movq	%rax, %rdx
	call	_ZNSolsEPFRSoS_E
	movl	$0, %eax
	addq	$32, %rsp
	popq	%rbp
	ret
	.seh_endproc
	.section .rdata,"dr"
_ZNSt8__detail30__integer_to_chars_is_unsignedIjEE:
	.byte	1
_ZNSt8__detail30__integer_to_chars_is_unsignedImEE:
	.byte	1
_ZNSt8__detail30__integer_to_chars_is_unsignedIyEE:
	.byte	1
	.ident	"GCC: (Rev7, Built by MSYS2 project) 13.1.0"
	.def	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc;	.scl	2;	.type	32;	.endef
	.def	_ZNSolsEPFRSoS_E;	.scl	2;	.type	32;	.endef
	.section	.rdata$.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_, "dr"
	.globl	.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	.linkonce	discard
.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_:
	.quad	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	.section	.rdata$.refptr._ZSt4cout, "dr"
	.globl	.refptr._ZSt4cout
	.linkonce	discard
.refptr._ZSt4cout:
	.quad	_ZSt4cout

My command was same for the both version, (without any optimisation option)

g++ .\main.cpp -S

for executable

g++ .\main.cpp -o .\main.exe

Using pacman -Qq | grep gcc in msys2shell, mingw64shell and ucrt64shell,
I get these packages

gcc-libs
mingw-w64-x86_64-gcc
mingw-w64-x86_64-gcc-ada
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-gcc-libgfortran
mingw-w64-x86_64-gcc-libs
mingw-w64-x86_64-gcc-objc
mingw-w64-x86_64-libgccjit

Same for all the shells

When I ran $ pacman -Qi gcc-libs in the shell it returned:

Name            : gcc-libs
Version         : 11.3.0-4
Description     : Runtime libraries shipped by GCC
Architecture    : x86_64
URL             : https://gcc.gnu.org/
Licenses        : GPL  LGPL  FDL  custom
Groups          : None
Provides        : None
Depends On      : None
Optional Deps   : None
Required By     : brotli  bsdtar  file  inetutils  libasprintf  libassuan  libbz2  libdb  libexpat  libgdbm
                  libgettextpo  libgnutls  libiconv  libintl  libksba  liblz4  libnghttp2  libnpth  libpcre  libpcre2_8
                  libutil-linux  libzstd  ncurses  wget  zlib  zstd
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 5.30 MiB
Packager        : CI (msys2/msys2-autobuild/79096b75/5113523851)
Build Date      : Mon, May 29, 2023 10:03:27 PM
Install Date    : Tue, Jul 18, 2023 9:15:05 AM
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature

Also, for more information, I'm adding this:

$ pacman -Qi | grep gcc-libs
Depends On      : gcc-libs
Depends On      : gcc-libs  libbz2  libiconv  libexpat  liblzma  liblz4  libopenssl  libzstd  zlib
Depends On      : gcc-libs  zlib  libbz2  liblzma  libzstd
Name            : gcc-libs
Depends On      : gcc-libs  libintl  libreadline  ncurses
Depends On      : gcc-libs
Depends On      : gcc-libs  libgpg-error
Depends On      : gcc-libs
Depends On      : gcc-libs
Depends On      : gcc-libs
Depends On      : gcc-libs  libreadline  libiconv  libintl  ncurses
Depends On      : gcc-libs
Depends On      : gcc-libs  libidn2  libiconv  libintl  gmp  libnettle  libp11-kit  libtasn1  zlib
Depends On      : gcc-libs  libintl
Depends On      : gcc-libs  libiconv
Depends On      : gcc-libs  libgpg-error
Depends On      : gcc-libs
Depends On      : gcc-libs
Depends On      : gcc-libs
Depends On      : gcc-libs
Depends On      : gcc-libs
Depends On      : gcc-libs  libintl
Depends On      : gcc-libs
Depends On      : mingw-w64-x86_64-gcc-libs
Depends On      : mingw-w64-x86_64-binutils  mingw-w64-x86_64-crt  mingw-w64-x86_64-headers  mingw-w64-x86_64-isl  mingw-w64-x86_64-libiconv  mingw-w64-x86_64-gmp  mingw-w64-x86_64-mpfr  mingw-w64-x86_64-mpc  mingw-w64-x86_64-gcc-libs=13.1.0-7  mingw-w64-x86_64-windows-default-manifest  mingw-w64-x86_64-winpthreads  mingw-w64-x86_64-zlib  mingw-w64-x86_64-zstd
Depends On      : mingw-w64-x86_64-gcc-libs=13.1.0-7
Name            : mingw-w64-x86_64-gcc-libs
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-mpc  mingw-w64-x86_64-mpfr  mingw-w64-x86_64-ncurses  mingw-w64-x86_64-python  mingw-w64-x86_64-readline  mingw-w64-x86_64-xxhash  mingw-w64-x86_64-zlib  mingw-w64-x86_64-zstd
Depends On      : mingw-w64-x86_64-expat  mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-libiconv
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-gettext
Required By     : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-winpthreads-git
Depends On      : mingw-w64-x86_64-gcc-libs
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-gmp
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-expat  mingw-w64-x86_64-bzip2  mingw-w64-x86_64-libffi  mingw-w64-x86_64-mpdecimal  mingw-w64-x86_64-ncurses  mingw-w64-x86_64-openssl  mingw-w64-x86_64-sqlite3  mingw-w64-x86_64-tcl  mingw-w64-x86_64-tk  mingw-w64-x86_64-zlib  mingw-w64-x86_64-xz  mingw-w64-x86_64-tzdata
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-termcap
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-readline  mingw-w64-x86_64-tcl  mingw-w64-x86_64-zlib
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-zlib
Depends On      : mingw-w64-x86_64-gcc-libs
Depends On      : mingw-w64-x86_64-gcc-libs
Depends On      : mingw-w64-x86_64-gcc-libs
Depends On      : gcc-libs
Depends On      : gcc-libs  libiconv  libidn2  libintl  libgpgme  libpcre2_8  libpsl  libuuid  libgnutls  zlib
Depends On      : gcc-libs
Depends On      : gcc-libs  libzstd

nurpr@Legion MSYS ~
$ pacman -Qi | grep mingw-w64-x86_64-gcc-libs
Depends On      : mingw-w64-x86_64-gcc-libs
Depends On      : mingw-w64-x86_64-binutils  mingw-w64-x86_64-crt  mingw-w64-x86_64-headers  mingw-w64-x86_64-isl  mingw-w64-x86_64-libiconv  mingw-w64-x86_64-gmp  mingw-w64-x86_64-mpfr  mingw-w64-x86_64-mpc  mingw-w64-x86_64-gcc-libs=13.1.0-7  mingw-w64-x86_64-windows-default-manifest  mingw-w64-x86_64-winpthreads  mingw-w64-x86_64-zlib  mingw-w64-x86_64-zstd
Depends On      : mingw-w64-x86_64-gcc-libs=13.1.0-7
Name            : mingw-w64-x86_64-gcc-libs
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-mpc  mingw-w64-x86_64-mpfr  mingw-w64-x86_64-ncurses  mingw-w64-x86_64-python  mingw-w64-x86_64-readline  mingw-w64-x86_64-xxhash  mingw-w64-x86_64-zlib  mingw-w64-x86_64-zstd
Depends On      : mingw-w64-x86_64-expat  mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-libiconv
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-gettext
Required By     : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-winpthreads-git
Depends On      : mingw-w64-x86_64-gcc-libs
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-gmp
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-expat  mingw-w64-x86_64-bzip2  mingw-w64-x86_64-libffi  mingw-w64-x86_64-mpdecimal  mingw-w64-x86_64-ncurses  mingw-w64-x86_64-openssl  mingw-w64-x86_64-sqlite3  mingw-w64-x86_64-tcl  mingw-w64-x86_64-tk  mingw-w64-x86_64-zlib  mingw-w64-x86_64-xz  mingw-w64-x86_64-tzdata
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-termcap
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-readline  mingw-w64-x86_64-tcl  mingw-w64-x86_64-zlib
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-zlib
Depends On      : mingw-w64-x86_64-gcc-libs
Depends On      : mingw-w64-x86_64-gcc-libs
Depends On      : mingw-w64-x86_64-gcc-libs

Running executable generated from 13.1 outputs nothing where, 12.3 executable outputs correctly. It used to work before I updated it. I also used same version of Mingw natively, and it had the same problem.

I also posted this on StackOverflow for help. Here is the link
I also have an issue on msys2 here

Is it some sort of bug in g++ 13.1. Why isn't it working?

Can the developers provide latest mingw-w64 installer?

I have downloaded the Mingw-w64 (10.0.0) zip. But can't figure out how to install MinGW-w64 from source.

Please can any body provide the steps of how to build mingw-w64 from source in a Windows system.

Or it will be better if the MinGW-w64 developer team would provide a installer for windows, containing the latest version of GCC (12.1.0)?

wcstok() defined differently in string.h and wchar.h for UCRT

When using a UCRT build of MinGW-w64 9.0.0 (see my personal builds at https://winlibs.com/) wcstok() seems to be defined differently in string.h and wchar.h.

string.h defines wcstok() with 2 arguments:

  wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;

wchar.h defines wcstok() with 3 arguments if _UCRT is defined:

#if defined(_UCRT)
  wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim,wchar_t **_Ptr) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
#else
  wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
#endif

This is giving me a lot of trouble with the ACE library when building YARP with UCRT.

mingw32-make.exe troubles on github ci

Hello, I have two projects using the exact same set of makefiles one just build fine the other one trigger errors on a single ruleset ; I went checking for all sort of things like space, bad characters ; nothing ; all sources are ascii cleared ; all filenames ok

here reference builds:

https://github.com/mu578/mu0/actions/runs/5165919329/jobs/9305715828
https://github.com/mu578/mu8/actions/runs/5165936223/jobs/9305740260


/usr/bin/sh: -c: line 3: syntax error: unexpected end of file
[170](https://github.com/mu578/mu8/actions/runs/5165936223/jobs/9305740260#step:4:171)
mingw32-make: [D:/a/mu8/mu8/mu0/mk/inc/mu0_ruleset.mk:77: rule_linker_cmds] Error 2 (ignored)
[171](https://github.com/mu578/mu8/actions/runs/5165936223/jobs/9305740260#step:4:172)
/usr/bin/sh: -c: line 13: syntax error: unexpected end of file
[172](https://github.com/mu578/mu8/actions/runs/5165936223/jobs/9305740260#step:4:173)
mingw32-make: [D:/a/mu8/mu8/mu0/mk/inc/mu0_ruleset.mk:78: rule_linker_cmds] Error 2 (ignored)
[173](https://github.com/mu578/mu8/actions/runs/5165936223/jobs/9305740260#step:4:174)
[mingw64_nt-10.0-20348-x86_64] Archive : mu8 <= libmu8.a
[174](https://github.com/mu578/mu8/actions/runs/5165936223/jobs/9305740260#step:4:175)
/usr/bin/sh: -c: line 3: syntax error: unexpected end of file
[175](https://github.com/mu578/mu8/actions/runs/5165936223/jobs/9305740260#step:4:176)
mingw32-make: [D:/a/mu8/mu8/mu0/mk/inc/mu0_ruleset.mk:49: rule_static] Error 2 (ignored)

if any clue ; welcome ; I also tried to reduce the number of files thinking about some argument list length or memory issues ; nothing ; so far as it is the same exact file ; it doesn't make any sense to me.

Is it an installation problem on some machines? sorry ; this is website ; wrong place ; but still ? is anyone ever experienced such?

Mention Homebrew on downloads page

Homebrew (https://brew.sh) offers mingw-w64 for both macOS (Intel and ARM) and Linux. It has the latest version (including GCC 12.2.0), and also a package for makensis.

Installation is made with brew install mingw-w64.

xinput.lib in the MinGW is using DirectX SDK only xinput1_3.dll

The xinput library that comes with the MinGW toolset is linking to the XINPUT1_3.DLL. This DLL is only installed by the legacy DirectX End-User Runtime, so it's not present on all machines. Also, this DLL has known security issues.

A better solution is to have libxinput.a link to XINPUT9_1_0.DLL which is present on all Windows machines from Windows Vista forward.

Alternatively, use XINPUT1_4.DLL which is present on Windows 8.0 or later and is also inbox.

Help my mingW64 has a handicap or my code (help)

So this is my code (i am trying to make a little joke virus for my friend)

#include <windows.h>
#include
#include <time.h>
void invertscreen() {
int x, y;
x = GetSystemMetrics(SM_CXSCREEN);
y = GetSystemMetrics(SM_CXSCREEN);
while (0 == 0) {
int randx, randy;
randx = rand() % x + 0;
randy = rand() % x + 0;
BitBlt(GetDC(NULL),rand() % x + 0, rand() % y + 0, randx + 200,randy+200,GetDC(NULL),randx,randy,NOTSRCCOPY);
}
}

int main()
{
invertscreen();
}

now once compiling i get this error: c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\mverb\AppData\Local\Temp\cchWKwR9.o:main.cpp:(.text+0xc2): undefined reference to `__imp_BitBlt'
collect2.exe: error: ld returned 1 exit status

if you know please help before i get a handicap :D

The MinGW headers are missing SAL annotations

Hello,

If we compare the prototypes from the Windows SDK:

WINBASEAPI
HANDLE
WINAPI
CreateFileA(
    _In_ LPCSTR lpFileName,
    _In_ DWORD dwDesiredAccess,
    _In_ DWORD dwShareMode,
    _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
    _In_ DWORD dwCreationDisposition,
    _In_ DWORD dwFlagsAndAttributes,
    _In_opt_ HANDLE hTemplateFile
    );

Versus the minGW ones:

  WINBASEAPI HANDLE WINAPI CreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);

You can see SAL annotations missing. Is there any way to generate them with those annotations ?

Cheers.

gdb has commandline encoding problem

>gdb --version
GNU gdb (GDB) 11.2
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

I used the following code to get a wargv in a GUI application.

static struct MyArgsW {
    wchar_t* basestr;
    int argc;
    wchar_t** argv;
    MyArgsW() {
        setlocale(LC_ALL, "");
        this->basestr = GetCommandLineW();
        this->argv = CommandLineToArgvW(this->basestr, &this->argc);
    }
    ~MyArgsW() {
        LocalFree(this->argv);
    }
} wargs;

However, when I launched the program with the following arguments (in vscode debug), it could not behave normally and will give wrong number of argc.
When used without gdb, it does what it should do.

            "args": [
                "--userdata-path", "E:\\Users\\23Xor\\Desktop\\OpenWebview2Window-ng\\dist\\bin\\x64\\webdata",
                "--navigate-url", "https://www.baidu.com",
                "--window-title", "百度一下",
                "--tray-control"
            ],

Here is the part of the memory of commandline got by GetCommandLineW.
21:53:59

We can see that "百度一下" was encoded to the following:
21:57:21

It seem to be an encoding problem, so I did an experiment to make sure.

百度一下
(encode with UTF-8)--->
\xE799BE\xE5BAA6\xE4B880\xE4B88B
(decode with GB2312, the ANSI codepage of my environment)--->
鐧惧害涓€涓?
(encode with UTF-16)--->
\u2794\uE760\uB35B\u936D\uAC20\u936D\u3F00

So let me guess, gdb give the commandline in UTF-8 encoding, but actually commandline is interpreted with ANSI encoding, and converted to UTF-16 encoding.

The msvc compiler compiled successfully, but the mingw compiler failed

#include <any>
#include <map>
#include <string>
struct AddressData
{
public:
    std::any value2;

    AddressData(std::any value2) : value2(std::move(value2)) {}

    AddressData() {}
    ~AddressData()
    {
    }

    AddressData(const AddressData &other)
        : value2(other.value2)
    {
    }

    AddressData &operator=(const AddressData &other)
    {
        if (this != &other)
        {
            value2 = other.value2;
        }
        return *this;
    }

    AddressData(AddressData&&) = default;
    AddressData& operator=(AddressData&&) = default;
};

int main(int argc, char *argv[])
{
    std::map<int,AddressData> map;
    map.insert(std::make_pair(1,AddressData(std::string())));
    map.insert(std::make_pair(2,AddressData(20)));
}

The error message is as follows:

D:\software\qt\Tools\mingw1120_64\lib\gcc\x86_64-w64-mingw32\11.2.0\include\c++\type_traits:935: error: invalid use of incomplete type 'struct std::__is_constructible_impl<AddressData, const AddressData&>'
C:/Users/Administrator/Documents/untitled6/main.cpp:39:15: required from here
D:/software/qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/type_traits:935:12: error: invalid use of incomplete type 'struct std::__is_constructible_impl<AddressData, const AddressData&>'
935 | struct __is_copy_constructible_impl<_Tp, true>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/software/qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/type_traits:905:12: note: declaration of 'struct std::__is_constructible_impl<AddressData, const AddressData&>'
905 | struct __is_constructible_impl
| ^~~~~~~~~~~~~~~~~~~~~~~

hello ! Is this a compiler bug? please tell me how to fix it. thanks

Argument list too long

Hello,
I tried to compiled a c code and at the linking stage i get the error "Argument list too long".
I tried to increase ulimit but still not working.
Is there a way to fix that ?

Thansk for helping.

Installation

2024 and a masters degree top of the class old school isn't enough to install this thing hassle-free.

Compile with mingw64 not found __builtin_ia32_paddsw128

I'm compiling the IntelRealsense SDK and I get this error in the mingw64 header when enabling SSE instructions.

I'm using the Mysys2 framework with mingw64.

Why is the function __builtin_ia32_paddsw128 not found? Is there any auxiliary library missing?

[build] D:/msys64/ucrt64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/tmmintrin.h: In function '__m128i _mm_hadd_epi16(__m128i, __m128i)':
[build] D:/msys64/ucrt64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/tmmintrin.h:42:20: error: '__builtin_ia32_phaddw128' was not declared in this scope; did you mean '__builtin_ia32_paddw128'?
[build]    42 |   return (__m128i) __builtin_ia32_phaddw128 ((__v8hi)__X, (__v8hi)__Y);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.