Hi,
I have a strange, at least for me, behavior with windows 11 25H2 64 bit, codeblock 25.03 with gcc 14.2.0 64 bit compiler and pointer.
The code is very simple:
#include <iostream>
using namespace std;
int main()
{
cout << sizeof(int *) << endl;
return 0;
}
The output is 4 byte on i5-10400 CPU that is wrong whereas is 8 byte on i5-11400 and various ryzen CPUs that is correct.
I tried to copy the same project into the different machines and I had problem only with the first one.
If I manually force -m 64 on the first machine, I get sorry, unimplemented: 64-bit mode not compiled in.. Then I have to manually set on build option minGW64 compiler instead of GCC and it works with -m 64, but it does with default settings.
What could be the reason for this?
Thank you
I am sure that there is only codeblocks 25.03 mingw 64 bit version. I triple checked :)
You can switch on html logging and submit compiler logs here to figure out what compiler is used actually.
default GCC compiler
-------------- Clean: Debug in test (compiler: GNU GCC Compiler)---------------
Cleaned "test - Debug"
-------------- Build: Debug in test (compiler: GNU GCC Compiler)---------------
g++.exe -Wall -fexceptions -m64 -g -c C:\Users\user\test\main.cpp -o obj\Debug\main.o
g++.exe -o bin\Debug\test.exe obj\Debug\main.o -m64
C:\Users\user\test\main.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in
#include <iostream>
^
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
minGW64 compiler
-------------- Clean: Debug in test (compiler: GNU GCC MinGW64 Compiler)---------------
Cleaned "test - Debug"
-------------- Build: Debug in test (compiler: GNU GCC MinGW64 Compiler)---------------
g++.exe -Wall -fexceptions -m64 -g -IC:\mingw-w64\mingw64\include -I"C:\Program Files\CodeBlocks\MinGW\include" -c C:\Users\user\test\main.cpp -o obj\Debug\main.o
g++.exe -LC:\mingw-w64\mingw64\lib -L"C:\Program Files\CodeBlocks\MinGW\lib" -o bin\Debug\test.exe obj\Debug\main.o -m64
Output file is bin\Debug\test.exe with size 109.55 KB
Process terminated with status 0 (0 minute(s), 3 second(s))
0 error(s), 0 warning(s) (0 minute(s), 3 second(s))
You seem to have two paths for compilers :
C:\mingw-w64\mingw64
and
C:\Program Files\CodeBlocks\MinGW
Both are used in the working test, for compiling (two sub \include paths) and for linking (two sub \lib paths).
Normally, you should have only one \include path and one \lib path. Two paths may give conflicts, especially if they are different.
The second compiler path, is, I suppose, for the installed compiler distributed with Code::Blocks (winlibs 14.2). How did you obtain the content of C:\mingw-w64\mingw64 ?
And how is configured your "GNU GCC Compiler" and your "GNU GCC MinGW64 Compiler".
As I saided previously, it looks like you have two compilers installed in two different places. But I'm not on your PC and cannot check this for you.
I don't have access to that computer at the moment, so I'll have to check. However, I usually download Codeblocks from its website or install it via Chocolatey, and I've never had this kind of problem.
On my main computer, I installed Windows 11 25H2 via VirtualBox and Codeblocks via Chocolatey, and it compiled the same code with the correct 64-bit compiler without changing any settings, as it should.
-------------- Clean: Debug in Test (compiler: GNU GCC Compiler)---------------
Cleaned "Test - Debug"
-------------- Build: Debug in Test (compiler: GNU GCC Compiler)---------------
g++.exe -Wall -fexceptions -g -c C:\Users\user\test\main.cpp -o obj\Debug\main.o
g++.exe -o bin\Debug\test.exe obj\Debug\main.o
Output file is bin\Debug\test.exe with size 109.55 KB
Process terminated with status 0 (0 minute(s), 3 second(s))
0 error(s), 0 warning(s) (0 minute(s), 3 second(s))