Can't compile anything

This is a discussion on Can't compile anything within the C++ Programming forums, part of the General Programming Boards category; Hi, My compiler (Dev C++) spits out about 500 errors followed by "There must be something terribly wrong with your ...

  1. #1
    Registered User
    Join Date
    Sep 2005
    Location
    USA
    Posts
    69

    Question Can't compile anything

    Hi,
    My compiler (Dev C++) spits out about 500 errors followed by "There must be something terribly wrong with your code. Please fix it." when I try to compile anything. Even one of the sample programs that came with Dev C++ or a simple hello world program.
    Does anyone know what is wrong?
    Any help would be greatly appreciated.
    Thanks.
    (The compile log is ridiculously long, but if it helps I will post it.)
    Adam

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Silly thing: Make sure you've got the program in plain text, with no fancy control characters. (If you didn't type it yourself, then you've probably got nothing to worry about here.)

    At least the first one or two errors may well be instructive.

  3. #3
    Registered User
    Join Date
    Jun 2008
    Posts
    127
    A small portion of the compile log would be helpful. Also, you can just try reinstalling it, that sometimes works. You can also try visual c++ 2008 express editions. Dev-c++ tends to give some hard to identify error codes especially if your a begginer.

  4. #4
    Registered User
    Join Date
    Sep 2005
    Location
    USA
    Posts
    69
    Well this is the code I'm using to test it:
    Code:
    #include <iostream>
    
    int main()
    {
    	std::cout << "Hello World!";
    	return 0;
    }
    Nothing too terribly fancy here .
    From the errors I'm seeing it looks like the problem is coming from iostream...
    Adam

  5. #5
    Registered User
    Join Date
    Sep 2005
    Location
    USA
    Posts
    69
    Here is part of the compile log. I just sorta cut it off at a random place.
    Code:
    Compiler: Default compiler
    Executing  g++.exe...
    g++.exe "C:\Documents and Settings\Adam\Desktop\Creature Creator\test.cpp" -o "C:\Documents and Settings\Adam\Desktop\Creature Creator\test.exe"   -g3  -I"C:\Documents and Settings\Adam\My Documents\Programming\Dev C++\Dev-Cpp\include\c++"  -I"C:\Documents and Settings\Adam\My Documents\Programming\Dev C++\Dev-Cpp\include\c++\mingw32"  -I"C:\Documents and Settings\Adam\My Documents\Programming\Dev C++\Dev-Cpp\include\c++\backward"  -I"C:\Documents and Settings\Adam\My Documents\Programming\Dev C++\Dev-Cpp\include"   -L"C:\Documents and Settings\Adam\My Documents\Programming\Dev C++\Dev-Cpp\lib" -g3 
    In file included from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/cstdio:52,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/c++io.h:35,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/bits/fpos.h:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iosfwd:46,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ios:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ostream:45,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iostream:45,
                     from C:/Documents and Settings/Adam/Desktop/Creature Creator/test.cpp:1:
    C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/stdio.h:35:20: _mingw.h: No such file or directory
    In file included from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/gthr-default.h:67,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/gthr.h:98,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/c++io.h:37,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/bits/fpos.h:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iosfwd:46,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ios:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ostream:45,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iostream:45,
                     from C:/Documents and Settings/Adam/Desktop/Creature Creator/test.cpp:1:
    C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/errno.h:31:20: _mingw.h: No such file or directory
    
    In file included from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/gthr.h:98,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/c++io.h:37,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/bits/fpos.h:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iosfwd:46,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ios:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ostream:45,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iostream:45,
                     from C:/Documents and Settings/Adam/Desktop/Creature Creator/test.cpp:1:
    C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/gthr-default.h:69:20: _mingw.h: No such file or directory
    In file included from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/winnt.h:37,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/windef.h:246,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/windows.h:48,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/gthr-default.h:462,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/gthr.h:98,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/c++io.h:37,
    
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/bits/fpos.h:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iosfwd:46,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ios:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ostream:45,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iostream:45,
                     from C:/Documents and Settings/Adam/Desktop/Creature Creator/test.cpp:1:
    C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/string.h:31:20: _mingw.h: No such file or directory
    In file included from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/windef.h:246,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/windows.h:48,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/gthr-default.h:462,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/gthr.h:98,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/c++io.h:37,
    
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/bits/fpos.h:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iosfwd:46,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ios:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ostream:45,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iostream:45,
                     from C:/Documents and Settings/Adam/Desktop/Creature Creator/test.cpp:1:
    C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/winnt.h:163:21: basetsd.h: No such file or directory
    In file included from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/windef.h:246,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/windows.h:48,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/gthr-default.h:462,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/gthr.h:98,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/c++io.h:37,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/bits/fpos.h:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iosfwd:46,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ios:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ostream:45,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iostream:45,
                     from C:/Documents and Settings/Adam/Desktop/Creature Creator/test.cpp:1:
    C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/winnt.h:1941: '
    
       SIZE_T' is used as a type, but is not defined as a type.
    C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/winnt.h:1942: '
       SIZE_T' is used as a type, but is not defined as a type.
    C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/winnt.h:1943: '
       SIZE_T' is used as a type, but is not defined as a type.
    C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/winnt.h:1944: '
       SIZE_T' is used as a type, but is not defined as a type.
    C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/winnt.h:1945: '
       SIZE_T' is used as a type, but is not defined as a type.
    
    In file included from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/windows.h:48,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/gthr-default.h:462,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/gthr.h:98,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/mingw32/bits/c++io.h:37,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/bits/fpos.h:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iosfwd:46,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ios:44,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/ostream:45,
                     from C:/Documents and Settings/Adam/My Documents/Programming/Dev C++/Dev-Cpp/include/c++/iostream:45,
    And I did try reinstalling it.
    Adam

  6. #6
    Registered User
    Join Date
    Jun 2008
    Posts
    127
    That code looks terribly incorrect(joking). Try downloading it again and reinstalling it. You might have accidently got the version without Mingw/GCC which might be the source of your errors.

  7. #7
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    If you don't have _mingw.h or basetsd.h, you're in trouble. I'm guessing you got the one that says "executable only", instead of the one that says "with Mingw/GCC"? And if you meant to do that (because you already have _mingw installed), I'm guessing you didn't set the path correctly.

  8. #8
    Registered User
    Join Date
    Jun 2008
    Posts
    127
    Just click on the one that comes with Mingw/GCC and it will compile correctly.

  9. #9
    Registered User
    Join Date
    Sep 2005
    Location
    USA
    Posts
    69
    Woo! It works!
    Thank you much.
    Adam

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C and C++ compile speed
    By swgh in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-02-2007, 01:37 PM
  2. Compile as you type
    By Rocketmagnet in forum A Brief History of Cprogramming.com
    Replies: 33
    Last Post: 12-07-2006, 12:36 PM
  3. How to compile mfc libs from platform sdk
    By tjcbs in forum Windows Programming
    Replies: 6
    Last Post: 11-19-2006, 07:20 AM
  4. Compile crashes certain windows
    By Loduwijk in forum C++ Programming
    Replies: 5
    Last Post: 03-26-2006, 08:05 PM
  5. How can I compile C or C++ with Visual Studio .NET?
    By Dakkon in forum C Programming
    Replies: 8
    Last Post: 02-11-2003, 01:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21