?
Solved

DEV-CPP windows console program

Posted on 2003-03-06
9
Medium Priority
?
757 Views
Last Modified: 2006-11-17
dev-cpp 4.9.7.0 gives me 70 errors when i try run this program, can anyone tell what to do?

#include <iostream.h>
#include <stdio.h>
#include <conio.h>

void main()
{ cout<<"Hello!";
}
0
Comment
Question by:mastamind
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
9 Comments
 

Expert Comment

by:e12voltsdac
ID: 8084797
you don't need stdio.h it is a C program,but that should be alright.

What kind of errors are they?

You might have your include directory configured wrong and make sure your making a C++ console program.

I had a ton of errors just like you then i adjusted and they were gone.
0
 
LVL 1

Expert Comment

by:allex87
ID: 8087565
try this program:

#include<iostream.h>

int main()
{
   cout<<"Hello World";
   return 0;
}

If it works... then maybe Dev C++ is incompatible (somehow) with using C++ libraries and C-style programming. I've had Deev C++ installed on my system, but i did not have this kind of errors...

Try re-installing it... maybe it couldn't install some libraries or something...
0
 

Author Comment

by:mastamind
ID: 8095339
i tried it, and it also gives me 70 errors
i tried uninstalling it, but it only removes the shortcuts in start menu and tells me to remove the progam folder manually. i removed the folder manually, then reinstalled it and the settings remained the same.:(


this is the compiler log output:

Compiler: Default compiler
Executing  g++.exe...
g++.exe "D:\Dev-Cpp\arthur.cpp" -o "D:\Dev-Cpp\arthur.exe"    -I"d:\Dev-Cpp\include"  -I"D:\Dev-Cpp\include\c++"  -I"D:\Dev-Cpp\include\c++\backward"  -I"d:\Dev-Cpp\include\c++"  -I"d:\Dev-Cpp\include"  -I"D:\Dev-Cpp\include\c++\backward"   -L"d:\Dev-Cpp\lib"
In file included from D:/Dev-Cpp/include/c++/backward/iostream.h:31,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
In file included from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/iostream:44:28: bits/c++config.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/ios:44,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/iosfwd:44:28: bits/c++config.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/iosfwd:45,
                 from D:/Dev-Cpp/include/c++/ios:44,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/bits/stringfwd.h:44:28: bits/c++config.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/iosfwd:46,
                 from D:/Dev-Cpp/include/c++/ios:44,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/bits/fpos.h:44:24: bits/c++io.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/bits/fpos.h:45,
                 from D:/Dev-Cpp/include/c++/iosfwd:46,
                 from D:/Dev-Cpp/include/c++/ios:44,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/cwchar:49:28: bits/c++config.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/iosfwd:46,
                 from D:/Dev-Cpp/include/c++/ios:44,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,

                 from D:/Dev-Cpp/arthur.cpp:1:

D:/Dev-Cpp/include/c++/bits/fpos.h:60: 'streamoff' is used as a type, but is
   not defined as a type.
D:/Dev-Cpp/include/c++/bits/fpos.h:74: parse error before `__off'
D:/Dev-Cpp/include/c++/bits/fpos.h:75: missing ';' before right brace
D:/Dev-Cpp/include/c++/bits/fpos.h:77: semicolon missing after declaration of `
   std::fpos<_StateT>'
D:/Dev-Cpp/include/c++/bits/fpos.h: In constructor
   `std::fpos<_StateT>::fpos()':
D:/Dev-Cpp/include/c++/bits/fpos.h:72: class `std::fpos<_StateT>' does not have
   any field named `_M_off'
D:/Dev-Cpp/include/c++/bits/fpos.h: At global scope:
D:/Dev-Cpp/include/c++/bits/fpos.h:77: parse error before `(' token
D:/Dev-Cpp/include/c++/bits/fpos.h:77: ISO C++ forbids defining types within
   return type
D:/Dev-Cpp/include/c++/bits/fpos.h:77: syntax error before `(' token
D:/Dev-Cpp/include/c++/bits/fpos.h:79: syntax error before `&' token
D:/Dev-Cpp/include/c++/bits/fpos.h:82: syntax error before `&' token
D:/Dev-Cpp/include/c++/bits/fpos.h:86: syntax error before `operator'
D:/Dev-Cpp/include/c++/bits/fpos.h:89: syntax error before `+=' token
D:/Dev-Cpp/include/c++/bits/fpos.h:94: syntax error before `operator'
D:/Dev-Cpp/include/c++/bits/fpos.h:97: syntax error before `-=' token
D:/Dev-Cpp/include/c++/bits/fpos.h:102: parse error before `&' token

D:/Dev-Cpp/include/c++/bits/fpos.h:103: non-member function `bool
   operator==(...)' cannot have `const' method qualifier
D:/Dev-Cpp/include/c++/bits/fpos.h:103: `bool operator==(...)' must have an
   argument of class or enumerated type
D:/Dev-Cpp/include/c++/bits/fpos.h:103: `bool operator==(...)' must take

   exactly two arguments

D:/Dev-Cpp/include/c++/bits/fpos.h: In function `bool operator==(...)':
D:/Dev-Cpp/include/c++/bits/fpos.h:103: `_M_off' undeclared (first use this
   function)
D:/Dev-Cpp/include/c++/bits/fpos.h:103: (Each undeclared identifier is reported
   only once for each function it appears in.)
D:/Dev-Cpp/include/c++/bits/fpos.h:103: `__pos' undeclared (first use this
   function)

D:/Dev-Cpp/include/c++/bits/fpos.h: At global scope:
D:/Dev-Cpp/include/c++/bits/fpos.h:106: parse error before `&' token
D:/Dev-Cpp/include/c++/bits/fpos.h:107: non-member function `bool

   operator!=(...)' cannot have `const' method qualifier
D:/Dev-Cpp/include/c++/bits/fpos.h:107: `bool operator!=(...)' must have an
   argument of class or enumerated type
D:/Dev-Cpp/include/c++/bits/fpos.h:107: `bool operator!=(...)' must take
   exactly two arguments
D:/Dev-Cpp/include/c++/bits/fpos.h:110: parse error before `)' token
D:/Dev-Cpp/include/c++/bits/fpos.h:113: `streamoff' was not declared in this
   scope
D:/Dev-Cpp/include/c++/bits/fpos.h:113: parse error before `)' token
D:/Dev-Cpp/include/c++/bits/fpos.h: In function `void _M_position(...)':
D:/Dev-Cpp/include/c++/bits/fpos.h:113: `__off' undeclared (first use this
   function)

D:/Dev-Cpp/include/c++/bits/fpos.h: At global scope:
D:/Dev-Cpp/include/c++/bits/fpos.h:114: parse error before `}' token
D:/Dev-Cpp/include/c++/bits/fpos.h:117: syntax error before `;' token

In file included from D:/Dev-Cpp/include/c++/ios:46,
                 from D:/Dev-Cpp/include/c++/ostream:45,

                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/bits/char_traits.h:59: parse error before `;' token
D:/Dev-Cpp/include/c++/bits/char_traits.h:60: parse error before `;' token

D:/Dev-Cpp/include/c++/bits/char_traits.h:113: parse error before `;' token
D:/Dev-Cpp/include/c++/bits/char_traits.h:114: parse error before `;' token
D:/Dev-Cpp/include/c++/bits/char_traits.h: In static member function `static
   int std::char_traits<char>::eof()':
D:/Dev-Cpp/include/c++/bits/char_traits.h:168: `EOF' undeclared (first use this
   function)

In file included from D:/Dev-Cpp/include/c++/ios:47,
                 from D:/Dev-Cpp/include/c++/ostream:45,

                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/cstdio:49:28: bits/c++config.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/ios:48,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/bits/localefwd.h:45:28: bits/c++config.h: No such file or directory

D:/Dev-Cpp/include/c++/bits/localefwd.h:46:80: bits/c++locale.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/bits/localefwd.h:48,
                 from D:/Dev-Cpp/include/c++/ios:48,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,

                 from D:/Dev-Cpp/arthur.cpp:1:

D:/Dev-Cpp/include/c++/cctype:48:28: bits/c++config.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/bits/localefwd.h:49,
                 from D:/Dev-Cpp/include/c++/ios:48,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,

                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/string:45:28: bits/c++config.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/memory:54,
                 from D:/Dev-Cpp/include/c++/string:48,
                 from D:/Dev-Cpp/include/c++/bits/localefwd.h:49,
                 from D:/Dev-Cpp/include/c++/ios:48,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/bits/stl_algobase.h:64:28: bits/c++config.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/bits/stl_algobase.h:67,
                 from D:/Dev-Cpp/include/c++/memory:54,
                 from D:/Dev-Cpp/include/c++/string:48,
                 from D:/Dev-Cpp/include/c++/bits/localefwd.h:49,
                 from D:/Dev-Cpp/include/c++/ios:48,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/cstdlib:49:28: bits/c++config.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/bits/stl_algobase.h:72,
                 from D:/Dev-Cpp/include/c++/memory:54,
                 from D:/Dev-Cpp/include/c++/string:48,
                 from D:/Dev-Cpp/include/c++/bits/localefwd.h:49,
                 from D:/Dev-Cpp/include/c++/ios:48,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/bits/type_traits.h:54:28: bits/c++config.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/bits/stl_iterator_base_funcs.h:68,
                 from D:/Dev-Cpp/include/c++/bits/stl_algobase.h:74,
                 from D:/Dev-Cpp/include/c++/memory:54,
                 from D:/Dev-Cpp/include/c++/string:48,
                 from D:/Dev-Cpp/include/c++/bits/localefwd.h:49,
                 from D:/Dev-Cpp/include/c++/ios:48,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/bits/concept_check.h:40:28: bits/c++config.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/bits/stl_alloc.h:86,
                 from D:/Dev-Cpp/include/c++/memory:55,
                 from D:/Dev-Cpp/include/c++/string:48,
                 from D:/Dev-Cpp/include/c++/bits/localefwd.h:49,
                 from D:/Dev-Cpp/include/c++/ios:48,

                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/bits/stl_threads.h:52:23: bits/gthr.h: No such file or directory
In file included from D:/Dev-Cpp/include/c++/bits/stl_alloc.h:86,
                 from D:/Dev-Cpp/include/c++/memory:55,

                 from D:/Dev-Cpp/include/c++/string:48,
                 from D:/Dev-Cpp/include/c++/bits/localefwd.h:49,
                 from D:/Dev-Cpp/include/c++/ios:48,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,
                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/bits/stl_threads.h: At global scope:
D:/Dev-Cpp/include/c++/bits/stl_threads.h:69: '__gthread_mutex_t' is used as a
   type, but is not defined as a type.
D:/Dev-Cpp/include/c++/bits/stl_threads.h:79:2: #error __GTHREAD_MUTEX_INIT or __GTHREAD_MUTEX_INIT_FUNCTION should be defined by gthr.h abstraction layer, report problem to libstdc++@gcc.gnu.org.
D:/Dev-Cpp/include/c++/bits/stl_threads.h: In member function `void
   std::_Refcount_Base::_M_incr()':
D:/Dev-Cpp/include/c++/bits/stl_threads.h:86: `_M_ref_count_lock' undeclared
   (first use this function)
D:/Dev-Cpp/include/c++/bits/stl_threads.h:86: `__gthread_mutex_lock' undeclared
   (first use this function)
D:/Dev-Cpp/include/c++/bits/stl_threads.h:88: `__gthread_mutex_unlock'
   undeclared (first use this function)
D:/Dev-Cpp/include/c++/bits/stl_threads.h: At global scope:

D:/Dev-Cpp/include/c++/bits/stl_threads.h:158: '__gthread_mutex_t' is used as a
   type, but is not defined as a type.
D:/Dev-Cpp/include/c++/bits/stl_threads.h: In member function `void

   std::_STL_mutex_lock::_M_acquire_lock()':
D:/Dev-Cpp/include/c++/bits/stl_threads.h:192: `_M_lock' undeclared (first use
   this function)

In file included from D:/Dev-Cpp/include/c++/memory:55,
                 from D:/Dev-Cpp/include/c++/string:48,
                 from D:/Dev-Cpp/include/c++/bits/localefwd.h:49,
                 from D:/Dev-Cpp/include/c++/ios:48,
                 from D:/Dev-Cpp/include/c++/ostream:45,
                 from D:/Dev-Cpp/include/c++/iostream:45,

                 from D:/Dev-Cpp/include/c++/backward/iostream.h:32,
                 from D:/Dev-Cpp/arthur.cpp:1:
D:/Dev-Cpp/include/c++/bits/stl_alloc.h: At global scope:
D:/Dev-Cpp/include/c++/bits/stl_alloc.h:575: syntax error before `;' token
D:/Dev-Cpp/include/c++/bits/stl_alloc.h:575: confused by earlier errors, bailing out

Execution terminated

a little long...
oh, and i veryfied, it's a windows console program.
there's another thing, dev-cpp is also installed at my school, and it works there...
some programs give me errors or warnings that borland c++ 3.11 doesnt, but it works pretty well...

thanks for trying to help :))
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Accepted Solution

by:
e12voltsdac earned 200 total points
ID: 8106958
Some of your directories are screwed up.
I'm guessing that you might have the newer version of the gcc comiler, but still the old directories.

From Dev-C++ go  -> Tools, Compiler options, Click the directories tab, then click the C++ Includes tab.

You should see the following directories:
C:\Program Files\Dev-Cpp\include
C:\Program Files\Dev-Cpp\include\g++-3
C:\Program Files\Dev-Cpp\include\g++-3\std
C:\Program Files\Dev-Cpp\include\gl

This is if dev-C++ is installed in that location, otherwise just put wheverever it is.

If a folder is not there, then click the little button with three dots to browse for a folder, then click ok and then click add.

When all of the folders are there, try running your program.

Hope that helped.
0
 

Author Comment

by:mastamind
ID: 8131617
my directories are right...
i tried  to incude only iostream, from the c++ dir, not iostream.h, wich is in c++\backward and it gives me less errors, but still won't work
i also tried to include the iostream.h from borland c++ 3.11, but that didn't work either
0
 
LVL 1

Expert Comment

by:allex87
ID: 8131758
My suggestion would be to get Microsoft Visual C++, which is more reliable. The one I use.
0
 

Expert Comment

by:e12voltsdac
ID: 8132318
In the directory menu tab thing, click on Delete invalid. This will clear all the messed up directories if any.

Look at some of your errors:

"D:/Dev-Cpp/include/c++/iostream:44:28: bits/c++config.h: No such file or directory"

"D:/Dev-Cpp/include/c++/bits/stl_threads.h:52:23: bits/gthr.h: No such file or directory"


The compiler isn't finding the directories, so they are probobly not setup right. If they seem to be right, then try finding the directories yourself.
bits/c++config.h means that it will look for a folder named bits inside one of your included directories.

That should fix it.

If that didn't work, then try downloading gcc, which is the compiler that dev-C++ uses.

Heres the gcc site:
https://sourceforge.net/project/showfiles.php?group_id=2435

I suggest you download gcc-2 because the newer version isn
t very compatible with dev-C++
0
 
LVL 11

Expert Comment

by:turn123
ID: 10112839
mastamind,
No comment has been added lately (307 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to e12voltsdac http:#8132318

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

turn123
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
Invest in your employees with these five simple steps to improve employee engagement and retention.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.
Viewers will learn how to use the Hootsuite Dashboard.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question