0

I just downloaded CLion, together with minGW, and created a project. After a lot of hazzle I managed to get the button for running the sample Hello World program. However, when I try to run the program it says that it compiles to 50% before giving me this error log: https://justpaste.it/wm14

It is extremely long, about 450 lines. And I have no idea why I get this error... Any help would be greatly appreciated! :)

The first few lines of the errors are as follows. There is a repeating pattern similar to this in the list of errors that begins In file included from followed by a list of errors such as has not been declared using or is not a member of 'std' or does not name a type:

In file included from c:\mingw\include\wchar.h:208:0,
from c:\mingw\lib\gcc\mingw32\4.9.3\include\c++\cwchar:44,
from c:\mingw\lib\gcc\mingw32\4.9.3\include\c++\bits\postypes.h:40,
from c:\mingw\lib\gcc\mingw32\4.9.3\include\c++\iosfwd:40,
from c:\mingw\lib\gcc\mingw32\4.9.3\include\c++\ios:38,
from c:\mingw\lib\gcc\mingw32\4.9.3\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\4.9.3\include\c++\iostream:39,
from C:\Users\Ole\Documents\programming\c++\testing\main.cpp:1:
c:\mingw\include\sys/stat.h:173:14: error: '_dev_t' does not name a type
struct _stat __struct_stat_defined( _off_t, time_t );
^
c:\mingw\include\sys/stat.h:173:14: error: '_ino_t' does not name a type
struct _stat __struct_stat_defined( _off_t, time_t );
^
c:\mingw\include\sys/stat.h:173:14: error: '_mode_t' does not name a type
struct _stat __struct_stat_defined( _off_t, time_t );
^

Here is the code:

#include "iostream"

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

I have managed to isolate the problem to the include statement. If I remove the include (and the cout), it builds fine, but if I add the include (and not the cout) it gives me the same error.

Update

I managed to solve this by simply deleting minGW and installing cygwin.

Richard Chambers
  • 16,643
  • 4
  • 81
  • 106
InzaneNova
  • 3
  • 2
  • 4
  • 1
    Please add your code to your question. – Ryan Bemrose Jul 25 '16 at 04:39
  • I have now added the code. – InzaneNova Jul 25 '16 at 17:26
  • I even managed to narrow down the problem :D – InzaneNova Jul 25 '16 at 21:20
  • 1
    See what happens if you change the quotes on the `include` directive to angle brackets instead. [Difference between angle bracket < > and double quotes “ ” while including header files in C++?](http://stackoverflow.com/questions/3162030/difference-between-angle-bracket-and-double-quotes-while-including-heade) as well as [What is the difference between #include and #include “filename”?](http://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename) I suspect a possible include search path problem. – Richard Chambers Jul 25 '16 at 21:31
  • I tried that and it didn't work, but it's solved now at least – InzaneNova Jul 25 '16 at 22:11
  • 1
    @InzaneNova, what did you change to make it work? – Richard Chambers Jul 25 '16 at 23:18
  • 1
    Your error log is blocked on my proxy at work. Thats why you should include all relevant information to the question and only provide bonus information as external link – grek40 Jul 26 '16 at 05:55
  • @RichardChambers I added the info at the end of the question, but I deleted minGW and used cygwin instead. – InzaneNova Sep 13 '16 at 11:30

1 Answers1

1

Try using

#include <iostream>

instead of

#include "iostream"
  • like Richard C suggested I'd also guess it's a search path problem.
mwallner
  • 985
  • 11
  • 23