Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
multi-arch code fails on mingw 64bits
I have a C/++ codebase that compiles in Windows x86_64 targeting x86 using the mingw32 32-bit shell of the MSYS64 project.
(It also compiles fine on linux x86/x86_64 and android's 4 archs.)
However, if i change to running it in the 64-bit shell, i get this error when compiling:
C:/msys64/mingw64/include/stdlib.h:303:23: error: expected ',' or '...' before numeric constant
303 | int __cdecl abs(int _X);
| ^~
the code block being:
#ifndef _CRT_ABS_DEFINED
#define _CRT_ABS_DEFINED
int __cdecl abs(int _X);
long __cdecl labs(long _X);
#endif
I believe this file comes from mingw-w64-x86_64-headers-git from the mingw-w64-x86_64-toolchain
metapackage.
I find it odd that this would be a MinGW error but what's triggering this on my code is a simple #include <string>
.
Among others, my Makefile has -lmingw64
, what am i missing?
Following @Lundin's comment i ended up reinstalling msys2/ucrt64 only, in another vm, and try again. Did clear that, but now i hit
C:/msys64/ucrt64/include/c++/14.2.0/limits:2100:30: error: unable to find numeric literal operator 'operator""Q'
2100 | return __extension__ 0x1.0p-16382Q;
| ^~~~~~~~~~~~~
the lines being
#ifdef __STRICT_ANSI__
// 0x1.0p-30 * 0x1.0p-16352
return double(9.3132257461547852e-10) * _S_1pm16352();
#else
return __extension__ 0x1.0p-16382Q;
#endif
I've tried with -D__STRICT_ANSI__
but it hits the same line (after a make clean
), so somewhere in the includes it's being undefined.
2 comment threads