Beginner Needs help in Dev-C++

This is a discussion on Beginner Needs help in Dev-C++ within the C++ Programming forums, part of the General Programming Boards category; Hey Everyone,
I just started reading a C++ book and I'm trying to follow along but for some reason the ...

Beginner Needs help in Dev-C++

Hey Everyone,
I just started reading a C++ book and I'm trying to follow along but for some reason the code doesn't compile and run. The book uses Dev-C++. I type in the code exactly how it is in the book but nothing comes up like it's supposed to. Here is the code it has me to enter in the compiler.

In file included from C:/Dev-Cpp/include/c++/iosfwd:46,
from C:/Dev-Cpp/include/c++/ios:44,
from C:/Dev-Cpp/include/c++/ostream:45,
from C:/Dev-Cpp/include/c++/iostream:45,
from main.cpp:1:
C:/Dev-Cpp/include/c++/bits/fpos.h:60: error: `streamoff' does not name a type

C:/Dev-Cpp/include/c++/bits/fpos.h:72: error: class `std::fpos<_StateT>' does not have any field named `_M_off'
C:/Dev-Cpp/include/c++/bits/fpos.h:72: error: there are no arguments to `streamoff' that depend on a template parameter, so a declaration of `streamoff' must be available
C:/Dev-Cpp/include/c++/bits/fpos.h:72: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
C:/Dev-Cpp/include/c++/bits/fpos.h: In member function `bool std::fpos<_StateT>:perator==(const std::fpos<_StateT>&) const':
C:/Dev-Cpp/include/c++/bits/fpos.h:103: error: `_M_off' undeclared (first use this function)
C:/Dev-Cpp/include/c++/bits/fpos.h:103: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:/Dev-Cpp/include/c++/bits/fpos.h: In member function `bool std::fpos<_StateT>:perator!=(const std::fpos<_StateT>&) const':
C:/Dev-Cpp/include/c++/bits/fpos.h:107: error: `_M_off' undeclared (first use this function)

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

from C:/Dev-Cpp/include/c++/iostream:45,
from main.cpp:1:
C:/Dev-Cpp/include/c++/bits/char_traits.h: At global scope:
C:/Dev-Cpp/include/c++/bits/char_traits.h:60: error: `streamoff' does not name a type
C:/Dev-Cpp/include/c++/bits/char_traits.h:114: error: `streamoff' does not name a type

In file included from C:/Dev-Cpp/include/c++/bits/localefwd.h:46,
from C:/Dev-Cpp/include/c++/ios:48,
from C:/Dev-Cpp/include/c++/ostream:45,
from C:/Dev-Cpp/include/c++/iostream:45,
from main.cpp:1:
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++locale.h: In function `int std::__convert_from_v(char*, int, const char*, _Tv, int* const&, int)':
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++locale.h:68: error: `snprintf' is not a member of `std'

In file included from C:/Dev-Cpp/include/c++/string:53,
from C:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from C:/Dev-Cpp/include/c++/ios:48,
from C:/Dev-Cpp/include/c++/ostream:45,
from C:/Dev-Cpp/include/c++/iostream:45,
from main.cpp:1:
C:/Dev-Cpp/include/c++/bits/basic_string.h: In member function `void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_dispose(const _Alloc&)':
C:/Dev-Cpp/include/c++/bits/basic_string.h:186: error: there are no arguments to `__exchange_and_add' that depend on a template parameter, so a declaration of `__exchange_and_add' must be available
C:/Dev-Cpp/include/c++/bits/basic_string.h: In member function `_CharT* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_refcopy()':
C:/Dev-Cpp/include/c++/bits/basic_string.h:196: error: there are no arguments to `__atomic_add' that depend on a template parameter, so a declaration of `__atomic_add' must be available

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

from C:/Dev-Cpp/include/c++/iostream:45,
from main.cpp:1:
C:/Dev-Cpp/include/c++/bits/localefwd.h: In member function `void std::locale::_Impl::_M_add_reference()':
C:/Dev-Cpp/include/c++/bits/localefwd.h:322: error: `__atomic_add' undeclared (first use this function)
C:/Dev-Cpp/include/c++/bits/localefwd.h: In member function `void std::locale::_Impl::_M_remove_reference()':
C:/Dev-Cpp/include/c++/bits/localefwd.h:327: error: `__exchange_and_add' undeclared (first use this function)

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

from C:/Dev-Cpp/include/c++/iostream:45,
from main.cpp:1:
C:/Dev-Cpp/include/c++/bits/ios_base.h: At global scope:
C:/Dev-Cpp/include/c++/bits/ios_base.h:240: error: `streamsize' does not name a type
C:/Dev-Cpp/include/c++/bits/ios_base.h:241: error: `streamsize' does not name a type
C:/Dev-Cpp/include/c++/bits/ios_base.h:360: error: `streamsize' does not name a type
C:/Dev-Cpp/include/c++/bits/ios_base.h:363: error: `streamsize' does not name a type

C:/Dev-Cpp/include/c++/bits/ios_base.h:371: error: `streamsize' does not name a type
C:/Dev-Cpp/include/c++/bits/ios_base.h:374: error: `streamsize' does not name a type
C:/Dev-Cpp/include/c++/bits/ios_base.h: In member function `void std::ios_base::_Callback_list::_M_add_reference()' :
C:/Dev-Cpp/include/c++/bits/ios_base.h:261: error: `__atomic_add' undeclared (first use this function)
C:/Dev-Cpp/include/c++/bits/ios_base.h: In member function `int std::ios_base::_Callback_list::_M_remove_reference ()':
C:/Dev-Cpp/include/c++/bits/ios_base.h:265: error: `__exchange_and_add' undeclared (first use this function)

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

from C:/Dev-Cpp/include/c++/iostream:45,
from main.cpp:1:
C:/Dev-Cpp/include/c++/streambuf: At global scope:
C:/Dev-Cpp/include/c++/streambuf:55: error: expected constructor, destructor, or type conversion before "__copy_streambufs"
C:/Dev-Cpp/include/c++/streambuf:55: error: expected `;' before "__copy_streambufs"
C:/Dev-Cpp/include/c++/streambuf:82: error: `streamsize' does not name a type

C:/Dev-Cpp/include/c++/streambuf:269: error: `streamsize' has not been declared
C:/Dev-Cpp/include/c++/streambuf:287: error: `streamsize' does not name a type
C:/Dev-Cpp/include/c++/streambuf:329: error: `streamsize' does not name a type
C:/Dev-Cpp/include/c++/streambuf:344: error: `streamsize' does not name a type
C:/Dev-Cpp/include/c++/streambuf:415: error: `streamsize' has not been declared
C:/Dev-Cpp/include/c++/streambuf:432: error: `streamsize' does not name a type
C:/Dev-Cpp/include/c++/streambuf:435: error: `streamsize' does not name a type
C:/Dev-Cpp/include/c++/streambuf:464: error: `streamsize' does not name a type

In file included from C:/Dev-Cpp/include/c++/bits/basic_ios.h:41,
from C:/Dev-Cpp/include/c++/ios:51,
from C:/Dev-Cpp/include/c++/ostream:45,
from C:/Dev-Cpp/include/c++/iostream:45,
from main.cpp:1:
C:/Dev-Cpp/include/c++/bits/locale_facets.h:448: error: `streamsize' has not been declared

C:/Dev-Cpp/include/c++/bits/locale_facets.h: In constructor `std::numpunct_byname<_CharT>::numpunct_byname(con st char*, size_t)':
C:/Dev-Cpp/include/c++/bits/locale_facets.h:564: error: there are no arguments to `_S_create_c_locale' that depend on a template parameter, so a declaration of `_S_create_c_locale' must be available
C:/Dev-Cpp/include/c++/bits/locale_facets.h:565: error: there are no arguments to `_M_initialize_numpunct' that depend on a template parameter, so a declaration of `_M_initialize_numpunct' must be available
C:/Dev-Cpp/include/c++/bits/locale_facets.h: In destructor `virtual std::numpunct_byname<_CharT>::~numpunct_byname()':
C:/Dev-Cpp/include/c++/bits/locale_facets.h:571: error: there are no arguments to `_S_destroy_c_locale' that depend on a template parameter, so a declaration of `_S_destroy_c_locale' must be available
C:/Dev-Cpp/include/c++/bits/locale_facets.h: In constructor `std::collate_byname<_CharT>::collate_byname(const char*, size_t)':
C:/Dev-Cpp/include/c++/bits/locale_facets.h:928: error: `_M_c_locale_collate' undeclared (first use this function)
C:/Dev-Cpp/include/c++/bits/locale_facets.h:928: error: `_S_c_locale' undeclared (first use this function)
C:/Dev-Cpp/include/c++/bits/locale_facets.h:929: error: there are no arguments to `_S_destroy_c_locale' that depend on a template parameter, so a declaration of `_S_destroy_c_locale' must be available
C:/Dev-Cpp/include/c++/bits/locale_facets.h:930: error: there are no arguments to `_S_create_c_locale' that depend on a template parameter, so a declaration of `_S_create_c_locale' must be available

C:/Dev-Cpp/include/c++/bits/locale_facets.h: In constructor `std::moneypunct_byname<_CharT, _Intl>::moneypunct_byname(const char*, size_t)':
C:/Dev-Cpp/include/c++/bits/locale_facets.h:1520: error: there are no arguments to `_S_create_c_locale' that depend on a template parameter, so a declaration of `_S_create_c_locale' must be available
C:/Dev-Cpp/include/c++/bits/locale_facets.h:1521: error: there are no arguments to `_M_initialize_moneypunct' that depend on a template parameter, so a declaration of `_M_initialize_moneypunct' must be available

C:/Dev-Cpp/include/c++/bits/locale_facets.h: In destructor `virtual std::moneypunct_byname<_CharT, _Intl>::~moneypunct_byname()':
C:/Dev-Cpp/include/c++/bits/locale_facets.h:1527: error: there are no arguments to `_S_destroy_c_locale' that depend on a template parameter, so a declaration of `_S_destroy_c_locale' must be available

In file included from C:/Dev-Cpp/include/c++/bits/locale_facets.h:1743,
from C:/Dev-Cpp/include/c++/bits/basic_ios.h:41,
from C:/Dev-Cpp/include/c++/ios:51,
from C:/Dev-Cpp/include/c++/ostream:45,
from C:/Dev-Cpp/include/c++/iostream:45,
from main.cpp:1:
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/messages_members.h: At global scope:
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/messages_members.h:39: error: redefinition of `std::messages<_CharT>::messages(size_t)'
C:/Dev-Cpp/include/c++/bits/locale_facets.h:1640: error: `std::messages<_CharT>::messages(size_t)' previously declared here
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/messages_members.h: In constructor `std::messages<_CharT>::messages(size_t)':
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/messages_members.h:40: error: there are no arguments to `_S_get_c_locale' that depend on a template parameter, so a declaration of `_S_get_c_locale' must be available

C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/messages_members.h: At global scope:
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/messages_members.h:44: error: redefinition of `std::messages<_CharT>::messages(int*, const char*, size_t)'
C:/Dev-Cpp/include/c++/bits/locale_facets.h:1646: error: `std::messages<_CharT>::messages(int*, const char*, size_t)' previously declared here
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/messages_members.h: In constructor `std::messages<_CharT>::messages(int*, const char*, size_t)':
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/messages_members.h:45: error: there are no arguments to `_S_get_c_locale' that depend on a template parameter, so a declaration of `_S_get_c_locale' must be available
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/messages_members.h: At global scope:
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/messages_members.h:56: error: redefinition of `std::messages<_CharT>::~messages()'
C:/Dev-Cpp/include/c++/bits/locale_facets.h:1671: error: `virtual std::messages<_CharT>::~messages()' previously declared here
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/messages_members.h:77: error: invalid use of undefined type `struct std::messages_byname<_CharT>'
C:/Dev-Cpp/include/c++/bits/localefwd.h:176: error: declaration of `struct std::messages_byname<_CharT>'
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/messages_members.h:77: error: template definition of non-template `std::messages_byname<_CharT>::messages_byname(con st char*, size_t)'
In file included from C:/Dev-Cpp/include/c++/bits/basic_ios.h:41,
from C:/Dev-Cpp/include/c++/ios:51,
from C:/Dev-Cpp/include/c++/ostream:45,
from C:/Dev-Cpp/include/c++/iostream:45,
from main.cpp:1:
C:/Dev-Cpp/include/c++/bits/locale_facets.h: In constructor `std::messages_byname<_CharT>::messages_byname(con st char*, size_t)':
C:/Dev-Cpp/include/c++/bits/locale_facets.h:1756: error: `_M_name_messages' undeclared (first use this function)
C:/Dev-Cpp/include/c++/bits/locale_facets.h:1757: error: `_M_c_locale_messages' undeclared (first use this function)
C:/Dev-Cpp/include/c++/bits/locale_facets.h:1757: error: `_S_c_locale' undeclared (first use this function)
C:/Dev-Cpp/include/c++/bits/locale_facets.h:1758: error: there are no arguments to `_S_destroy_c_locale' that depend on a template parameter, so a declaration of `_S_destroy_c_locale' must be available
C:/Dev-Cpp/include/c++/bits/locale_facets.h:1759: error: there are no arguments to `_S_create_c_locale' that depend on a template parameter, so a declaration of `_S_create_c_locale' must be available

In file included from C:/Dev-Cpp/include/c++/iostream:45,
from main.cpp:1:
C:/Dev-Cpp/include/c++/ostream: At global scope:

C:/Dev-Cpp/include/c++/ostream:161: error: `streamsize' has not been declared

In file included from C:/Dev-Cpp/include/c++/istream:45,
from C:/Dev-Cpp/include/c++/iostream:46,
from main.cpp:1:
C:/Dev-Cpp/include/c++/limits:48:29: bits/cpu_limits.h: No such file or directory
In file included from C:/Dev-Cpp/include/c++/iostream:46,
from main.cpp:1:
C:/Dev-Cpp/include/c++/istream:71: error: `streamsize' does not name a type

C:/Dev-Cpp/include/c++/istream:147: error: `streamsize' does not name a type
C:/Dev-Cpp/include/c++/istream:158: error: `streamsize' has not been declared
C:/Dev-Cpp/include/c++/istream:161: error: `streamsize' has not been declared
C:/Dev-Cpp/include/c++/istream:172: error: `streamsize' has not been declared
C:/Dev-Cpp/include/c++/istream:175: error: `streamsize' has not been declared
C:/Dev-Cpp/include/c++/istream:179: error: expected `;' before '(' token
C:/Dev-Cpp/include/c++/istream:185: error: `streamsize' has not been declared
C:/Dev-Cpp/include/c++/istream:187: error: `streamsize' does not name a type
C:/Dev-Cpp/include/c++/istream: In constructor `std::basic_istream<_CharT, _Traits>::basic_istream(std::basic_streambuf<_Char T, _Traits>*)':
C:/Dev-Cpp/include/c++/istream:79: error: `_M_gcount' undeclared (first use this function)
C:/Dev-Cpp/include/c++/istream:79: error: there are no arguments to `streamsize' that depend on a template parameter, so a declaration of `streamsize' must be available
C:/Dev-Cpp/include/c++/istream: In destructor `virtual std::basic_istream<_CharT, _Traits>::~basic_istream()':
C:/Dev-Cpp/include/c++/istream:84: error: `_M_gcount' undeclared (first use this function)
C:/Dev-Cpp/include/c++/istream:84: error: there are no arguments to `streamsize' that depend on a template parameter, so a declaration of `streamsize' must be available

main.cpp: In function `int main(int, char**)':

main.cpp:6: error: `cout' undeclared (first use this function)

main.cpp:6: error: `endl' undeclared (first use this function)

make.exe: *** [main.o] Error 1

Execution terminated

I just copied everything in that area. I'm sorry to anyone if that's frustrating but I am really new with this stuff and this book won't do it right i guess because different things happen when i try it myself than in the book.

Other's here have your answer, I just wanted to address your last point.

It was true for nearly all of us that in the early phase of study, it seems daunting.

It's also true that all of us made it through that phase, and you will too if you keep the attitude of your last clause - if so many have made it through that phase, you can too.

There's a 'critical mass' of information that must build up before it begins to fall into place. Even afterwards, there will appear stages where you find yourself stuck like this, but persistence will pay off. The languages, the entire technology, was designed to work and it does work. I can't count how many times, during my early years, I insisted the compiler had gone nuts and simply wasn't understanding my code, or that it was NOT doing what it should be doing. That view has never persisted, though - there's always a reason behind it. If nothing else, that's a main theme in this study. You might find yourself in disagreement with the reasoning, you might think it's illogical at first, but this is a variation of the same thing. If you have the time to follow along the full extent of the reasoning, it makes a lot more sense in the long run.

Best of luck - it will come to you just like it finally came to each of us.

Personally (and I'm still at the very basic beginning stages of learning C++) I had to go through four different C++ books before I found one that spoke to me in a way that actually clicked. However, from each book I learnt a bit more, and when I got to a section in the next book that I'd had trouble with there were a lot of "Ahhhhh now I get it!" moments. I could have given up as soon as I hit the first hurdle, but I thought there must be a different approach so had a look at a different resource and although it was teaching the same thing, the way it was taught made it easier to understand.

To cut through the guff, don't limit your learning to one book (especially one that misses out 'using namespace std;' or references to it in the very first program) - there are a load of resources now online (FREE) to look at as well as a gazillion books (I'd avoid the "learn C++ in 30 seconds/24 hours/ a week" type books though).