MinGW64 | MinGW64 compiler for running and debugging C
kandi X-RAY | MinGW64 Summary
kandi X-RAY | MinGW64 Summary
MinGW64 compiler for running and debugging C/C++ code in Visual Studio Code in Windows.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MinGW64
MinGW64 Key Features
MinGW64 Examples and Code Snippets
Community Discussions
Trending Discussions on MinGW64
QUESTION
ANSWER
Answered 2022-Apr-01 at 23:28Thanks to comment of @torek, I managed to use the commands after installing Per
You should not have.
- The latest versions of Git for Windows no longer use Perl for
git add
(mingw64/libexec/git-core/git-add.exe
). This is rewritten in C since Git 2.25, Q1 2020. perl.exe
is part of the Git for Windows distribution: make sure your%PATH%
includesC:\path\to\Git\usr\bin
There is no need to install Perl for Git to run.
2 years later (Q1 2022), With Git 2.36 (Q2 2022), there are still finishing touches to C rewrite of "git add -i
"(man) in single-key interactive mode.
See commit 0f584de, commit 6606d99, commit e4938ce, commit 02af15d (16 Mar 2022) by Phillip Wood (phillipwood
).
See commit 32f3ac2 (09 Mar 2022) by Junio C Hamano (gitster
).
(Merged by Junio C Hamano -- gitster
-- in commit d723492, 30 Mar 2022)
terminal
: restore settings on SIGTSTPSigned-off-by: Phillip Wood
If the user suspends git while it is waiting for a keypress reset the terminal before stopping and restore the settings when git resumes.
If the user tries to resume in the background print an error message (taking care to use async safe functions) before stopping again.
Ideally we would reprint the prompt for the user when git resumes but this patch just restarts theread()
.The signal handler is established with
sigaction()
rather than usingsigchain_push()
as this allows us to control the signal mask when the handler is invoked and ensureSA_RESTART
is used to restart the read() when resuming.
QUESTION
When I try to compile a Cython project with submodules using the gmp library and including C ++ files, I get an error:
...ANSWER
Answered 2022-Feb-16 at 10:23I just accidentally found the solution to the above problem. The problem is the package setuptools
(which in my case is the version 60.9.1)! Indeed, by executing python setup.py build_ext --inplace --compiler=mingw32
, the latter will call the class Mingw32CCompiler
into setuptools/_distutils/cygwinccompiler.py
which contains these two lines:
QUESTION
Until now, I've always written Assembly-code in GAS Syntax on Linux, so I wanted to try out how it'd be on Windows. The first goal was to print a single character onto stdout - which didn't work
Here's my code:
...ANSWER
Answered 2022-Jan-16 at 23:21main:
sub rsp, 8
mov rcx, -11
call GetStdHandle
QUESTION
I'm trying to draw on a window with Gtkmm for C++, cairo::context, gdk::pixbuf. I've noticed that for some widths (in my example 298), instead of my image, I get some horizontal black lines (alternated with white stripes).
For other widths (in my example 300) I get a normal image. (I'm just drawing a yellow background in my example).
What am I doing wrong ? How can I obtain to draw correctly for any image width ?
I'm finding this behavior both on :
windows 10 / msys2 / gcc11.2 / std=c++20
opensuse 15.2 / gcc 11.2.1 / std=c++17
and on both I have library versions:
-I/usr/include/gtkmm-3.0 -L/usr/lib64 -I/usr/lib64/glibmm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib64/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/include/sigc++-2.0/ -I/usr/lib64/sigc++-2.0/include -I/usr/include/giomm-2.4 -I/usr/lib64/giomm-2.4/include -I/usr/include/gdkmm-3.0 -I/usr/lib64/gdkmm-3.0/include -I/usr/lib64/pangomm-1.4/include -I/usr/include/gtk-3.0/ -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairomm-1.0 -I/usr/include/cairomm-1.0/cairomm -I/usr/lib64/cairomm-1.0/include -I/usr/include/freetype2 -I/usr/lib64/gtkmm-3.0/include -I/usr/include/pangomm-1.4 -I/usr/include/harfbuzz -I/usr/include/atkmm-1.6 -I/usr/include/atk-1.0 -I/usr/lib64/atkmm-1.6/include -LC:/programs/msys64/mingw64/bin -lgtkmm-3.0 -lglibmm-2.4 -I/usr/include/sigc++-2.0 -lsigc-2.0 -lgdkmm-3.0 -latkmm-1.6 -lcairomm-1.0
Here's my code:
...ANSWER
Answered 2022-Jan-07 at 11:30I'm used to the fact that image rows are often (not always) stored with a certain alignment. Whenever I see an image that appears erroneously in stripes, the row alignment is the first thing I would check.
With this suspicion in mind, I look for some gdkmm (or Gdk) doc. Instead I found a comment in the Gdk source code.
QUESTION
Apparently, the constexpr std::string has not been added to libstdc++ of GCC yet (as of GCC v11.2).
This code:
...ANSWER
Answered 2022-Jan-03 at 21:36C++20 supports allocation during constexpr time, as long as the allocation is completely deallocated by the time constant evaluation ends. So, for instance, this very silly example is valid in C++20:
QUESTION
When running anything related to the pylint
- command in the MINGW64-bash-CLI on Windows 10
, be it e.g.
ANSWER
Answered 2021-Sep-29 at 09:16I'm a pylint maintainer. Can you upgrade to the latest pylint with pip install pylint -U
and check that the problem still exists ? If it does this is definitely a problem with pylint. You can open an issue in pylint issue tracker so it gets fixed.
QUESTION
I installed MSYS2-64bits on my Windows Server 2016 to support some Linux librairies, such as OpenSSL, which I need in my Ruby on Rails development. MSYS2 has been partially installed with Ruby 2.7, but did not complete due to certificates error messages.
I first downloaded and install msys2-x86_64-20210725.exe. It took a very long time and finished after a few messages about Updating the trust database:
...ANSWER
Answered 2021-Dec-17 at 20:02Great question, but it's not exactly the corporate proxy refusing self-signed certificates; it's pacman's SSL agent.
In your browser, go to repo.msys2.org to find which certificates are being used:
Open details:
You'll need to export all certificates individually, but don't need the lowest one for repo.msys2.org:
Save to a local file:
Export using Base-64 encoding:
Can save directly to the trust source anchors folder. Things move around from time to time, but as of now, that's C:\msys64\etc\pki\ca-trust\source\anchors\.cer
Go through the same steps to import the top-level root certificate. Save in the same path, different file name.
QUESTION
Please, observe the following short scenario (this is in Powershell):
...ANSWER
Answered 2021-Dec-09 at 01:32You could try using join
to replace the CRLF with unix EOL:
QUESTION
A simple code like this printf("hex representation for %f is [%a]\n", 3.14, 3.14);
, I expect the result to be 0x4048f5c3
(full binary version is: 0100 0000 0100 1000 1111 0101 1100 0011
, 0x4.8f5c3p-1
) according to reference websites below, but the compiled executable shows [0xc.8f5c3p-2]
(binary: 1100.1000 1111 0101 1100 0011
), why did the C compiler shows exponent as -2 instead of -1?
The compiler setting is:
...ANSWER
Answered 2021-Nov-29 at 13:53The website you are using is displaying the binary representation of a floating-point number. For example, 3.14
is 40 48 F5 C3
in big-endian, or C3 F5 48 40
in little-endian.
The hex representation in C is the actual floating-point number in base 16, not it's binary representation. 0xc.8f5c3p-2
means c.8f5c3 * 2^(-2)
. If we convert this to decimal using the usual conversion algorithm, we get 3.14
:
12(C) * 16^0 + 8 * 16^(-1) + 15(F) * 16^(-2) + 5 * 16^(-3) + 12(C) * 16^(-4) + 3 * 16^(-5) = 12 + 0.5 + 0.05859 + ... = 12.56
(with approximation)
Now multiply by 2^(-2)
, or divide by 4
, and we get 3.14
.
The difference between the 2 representations is shown here (note that this program technically causes undefined behavior in C, because of the uint32_t*
to float*
cast followed by dereference, but in this case the behavior is to use the binary representation to create a floating-point number, as one would expect):
QUESTION
template
int get_num(const T&)
{
return 42;
}
struct Foo
{
int i = get_num(*this);
};
int get_num(const Foo&)
{
return 23;
}
int main()
{
std::cout << Foo().i << std::endl; // MinGW64 - 42, MSVC - 23
return 0;
}
...ANSWER
Answered 2021-Nov-14 at 20:31For the first sample, MinGW is correct and MSVC is incorrect: the get_num
call can only consider the function template.
This is a question of overload resolution, so I'll start in clause [over]. get_num(*this)
is a plain function call expression, so [over.call.func] applies:
In unqualified function calls, the name is not qualified by an
->
or.
operator and has the more general form of a primary-expression. The name is looked up in the context of the function call following the normal rules for name lookup in function calls. The function declarations found by that lookup constitute the set of candidate functions.
"Name lookup" is discussed in section [basic.lookup]. Paragraph 2:
A name "looked up in the context of an expression" is looked up as an unqualified name in the scope where the expression is found.
One complication here is that the get_num(*this)
default member initializer expression doesn't get used by anything until the default constructor of Foo
is implicitly defined by its odr-use in main
. But the lookup is determined from the code location of the expression itself, no matter that it's used in the process of that implicit definition.
For the second code sample, MinGW is again correct: the apparently recursive call inside the template definition actually calls the non-template function.
This is a result of "two phase lookup" for dependent function calls, described in section [temp.dep.res]. Briefly, since the type of t
depends on a template parameter, the name get_num
in the expression get_num(t)
is considered a dependent name. So for each instantiation of the function template, it gets two ways of finding candidates for overload resolution: the ordinary immediate way which finds the get_num
function template, plus another lookup from the point of instantiation. The specialization get_num
has point of instantiation right after the main()
definition, so overload resolution is able to find the non-template from the instantiation context, and the non-template wins overload resolution.
(Argument-dependent lookup is a related tangent issue to this second point. ADL applies to declarations from the instantiation context but not declarations from the definition context. But it's not directly a reason for the behaviors in either example program.)
None of this has changed significantly between C++14 and the latest draft, as far as I can see.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MinGW64
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page