0
votes

The full error I'm receiving on a simple hello world is, and the code is...

#include <iostream>

int main() {
    std::cout << "Hello, world!";
    return 0;
}

I downloaded MinGW and installed mingw32-base, mingw32-gcc-g++ and msys-base...

I downloaded and installed CodeLite 64 bit and scanned my computer for a C++ compiler in the setup wizard and selected MinGW. MinGW is also in my Path in the Environment Variables.

C:\WINDOWS\system32\cmd.exe /C C:/MinGW/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f  Makefile

"----------Building project:[ HelloWorld - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/owner/Documents/CPPWorkspace/HelloWorld'
C:/MinGW/bin/g++.exe  -c  "C:/Users/owner/Documents/CPPWorkspace/HelloWorld/main.cpp" -std=c++14 -Wall -g -O0 -Wall  -o ./Debug/main.cpp.o -I. -I.
In file included from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\cstdio:42,
             from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ext\string_conversions.h:43,
             from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\basic_string.h:6391,
             from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\string:52,
             from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\locale_classes.h:40,
             from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\ios_base.h:41,
             from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ios:42,
             from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ostream:38,
             from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\iostream:39,
             from C:/Users/owner/Documents/CPPWorkspace/HelloWorld/main.cpp:1:
c:\mingw\include\stdio.h:788:34: error: '__off64_t' does not name a type; did you mean '__time64_t'?
 typedef union { __int64 __value; __off64_t __offset; } fpos_t;
                              ^~~~~~~~~
                              __time64_t
mingw32-make.exe[1]: *** [Debug/main.cpp.o] Error 1
HelloWorld.mk:97: recipe for target 'Debug/main.cpp.o' failed
mingw32-make.exe[1]: Leaving directory 'C:/Users/owner/Documents/CPPWorkspace/HelloWorld'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====1 errors, 0 warnings====

Does anyone understand why I am unable to build and execute the file?

1
What is in your makefile? Did you try to compile your sample with g++? - chronoxor

1 Answers

0
votes

I successfully build your sample with C:\MinGW\bin\g++ test.cpp -o test.exe command.

However I recommend you go with MinGW-w64 which is improved version that supports both 32bit and 64bit compilation.