Thread: [Dev-C++] Compiling problems with 4.9.7.0 and GCC 3.2
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Dany P. W. <da...@qu...> - 2003-01-16 05:37:56
|
Hi everyone,
This problem has probably come up for discussion numerous times before.
It's certainly puzzled me to no end, being a learner at this whole C++
business.
I figured, by looking in the include directory, that I should use
iostream instead of iostream.h
That much seemed obvious but when I typed this typical beginner's code:
==================================
#include <iostream>
main()
{
cout << "Hello world!";
return(0);
}
==================================
I got some humangous amount of errors, 70 I think. I apologise for the
length of this log but I thought I better include it for the sake of
completion. You guys probably know this already.
The question is, where have I gone wrong? What's happening here? Any
help would be immensely appreciated.
Cheers,
Dany.
<quote compile log>
Compiler: Default compiler
Executing g++.exe...
g++.exe "D:\Documents and Settings\Dany\My Documents\test.cpp" -o
"D:\Documents and Settings\Dany\My Documents\test.exe"
-I"F:\Dev-Cpp\include\c++" -I"F:\Dev-Cpp\include" -L"F:\Dev-Cpp\lib"
In file included from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/iostream:44:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/ios:44,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/iosfwd:44:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/iosfwd:45,
from F:/Dev-Cpp/include/c++/ios:44,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/stringfwd.h:44:28: bits/c++config.h: No such
file or directory
In file included from F:/Dev-Cpp/include/c++/iosfwd:46,
from F:/Dev-Cpp/include/c++/ios:44,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/fpos.h:44:24: bits/c++io.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/bits/fpos.h:45,
from F:/Dev-Cpp/include/c++/iosfwd:46,
from F:/Dev-Cpp/include/c++/ios:44,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/cwchar:49:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/iosfwd:46,
from F:/Dev-Cpp/include/c++/ios:44,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/fpos.h:60: 'streamoff' is used as a type,
but is
not defined as a type.
F:/Dev-Cpp/include/c++/bits/fpos.h:74: parse error before `__off'
F:/Dev-Cpp/include/c++/bits/fpos.h:75: missing ';' before right brace
F:/Dev-Cpp/include/c++/bits/fpos.h:77: semicolon missing after
declaration of `
std::fpos<_StateT>'
F:/Dev-Cpp/include/c++/bits/fpos.h: In constructor
`std::fpos<_StateT>::fpos()':
F:/Dev-Cpp/include/c++/bits/fpos.h:72: class `std::fpos<_StateT>' does
not have any field named `_M_off'
F:/Dev-Cpp/include/c++/bits/fpos.h: At global scope:
F:/Dev-Cpp/include/c++/bits/fpos.h:77: parse error before `(' token
F:/Dev-Cpp/include/c++/bits/fpos.h:77: ISO C++ forbids defining types
within
return type
F:/Dev-Cpp/include/c++/bits/fpos.h:77: syntax error before `(' token
F:/Dev-Cpp/include/c++/bits/fpos.h:79: syntax error before `&' token
F:/Dev-Cpp/include/c++/bits/fpos.h:82: syntax error before `&' token
F:/Dev-Cpp/include/c++/bits/fpos.h:86: syntax error before `operator'
F:/Dev-Cpp/include/c++/bits/fpos.h:89: syntax error before `+=' token
F:/Dev-Cpp/include/c++/bits/fpos.h:94: syntax error before `operator'
F:/Dev-Cpp/include/c++/bits/fpos.h:97: syntax error before `-=' token
F:/Dev-Cpp/include/c++/bits/fpos.h:102: parse error before `&' token
F:/Dev-Cpp/include/c++/bits/fpos.h:103: non-member function `bool
operator==(...)' cannot have `const' method qualifier
F:/Dev-Cpp/include/c++/bits/fpos.h:103: `bool operator==(...)' must have
an
argument of class or enumerated type
F:/Dev-Cpp/include/c++/bits/fpos.h:103: `bool operator==(...)' must take
exactly two arguments
F:/Dev-Cpp/include/c++/bits/fpos.h: In function `bool operator==(...)':
F:/Dev-Cpp/include/c++/bits/fpos.h:103: `_M_off' undeclared (first use
this
function)
F:/Dev-Cpp/include/c++/bits/fpos.h:103: (Each undeclared identifier is
reported
only once for each function it appears in.)
F:/Dev-Cpp/include/c++/bits/fpos.h:103: `__pos' undeclared (first use
this
function)
F:/Dev-Cpp/include/c++/bits/fpos.h: At global scope:
F:/Dev-Cpp/include/c++/bits/fpos.h:106: parse error before `&' token
F:/Dev-Cpp/include/c++/bits/fpos.h:107: non-member function `bool
operator!=(...)' cannot have `const' method qualifier
F:/Dev-Cpp/include/c++/bits/fpos.h:107: `bool operator!=(...)' must have
an
argument of class or enumerated type
F:/Dev-Cpp/include/c++/bits/fpos.h:107: `bool operator!=(...)' must take
exactly two arguments
F:/Dev-Cpp/include/c++/bits/fpos.h:110: parse error before `)' token
F:/Dev-Cpp/include/c++/bits/fpos.h:113: `streamoff' was not declared in
this
scope
F:/Dev-Cpp/include/c++/bits/fpos.h:113: parse error before `)' token
F:/Dev-Cpp/include/c++/bits/fpos.h: In function `void _M_position(...)':
F:/Dev-Cpp/include/c++/bits/fpos.h:113: `__off' undeclared (first use
this
function)
F:/Dev-Cpp/include/c++/bits/fpos.h: At global scope:
F:/Dev-Cpp/include/c++/bits/fpos.h:114: parse error before `}' token
F:/Dev-Cpp/include/c++/bits/fpos.h:117: syntax error before `;' token In
file included from F:/Dev-Cpp/include/c++/ios:46,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/char_traits.h:59: parse error before `;'
token
F:/Dev-Cpp/include/c++/bits/char_traits.h:60: parse error before `;'
token F:/Dev-Cpp/include/c++/bits/char_traits.h:113: parse error before
`;' token
F:/Dev-Cpp/include/c++/bits/char_traits.h:114: parse error before `;'
token
F:/Dev-Cpp/include/c++/bits/char_traits.h: In static member function
`static
int std::char_traits<char>::eof()':
F:/Dev-Cpp/include/c++/bits/char_traits.h:168: `EOF' undeclared (first
use this
function) In file included from F:/Dev-Cpp/include/c++/ios:47,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/cstdio:49:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/localefwd.h:45:28: bits/c++config.h: No such
file or directory
F:/Dev-Cpp/include/c++/bits/localefwd.h:46:80: bits/c++locale.h: No such
file or directory
In file included from F:/Dev-Cpp/include/c++/bits/localefwd.h:48,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/cctype:48:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/string:45:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/memory:54,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/stl_algobase.h:64:28: bits/c++config.h: No
such file or directory
In file included from F:/Dev-Cpp/include/c++/bits/stl_algobase.h:67,
from F:/Dev-Cpp/include/c++/memory:54,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/cstdlib:49:28: bits/c++config.h: No such file or
directory
In file included from F:/Dev-Cpp/include/c++/bits/stl_algobase.h:72,
from F:/Dev-Cpp/include/c++/memory:54,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/type_traits.h:54:28: bits/c++config.h: No
such file or directory
In file included from
F:/Dev-Cpp/include/c++/bits/stl_iterator_base_funcs.h:68,
from F:/Dev-Cpp/include/c++/bits/stl_algobase.h:74,
from F:/Dev-Cpp/include/c++/memory:54,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/concept_check.h:40:28: bits/c++config.h: No
such file or directory
In file included from F:/Dev-Cpp/include/c++/bits/stl_alloc.h:86,
from F:/Dev-Cpp/include/c++/memory:55,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/stl_threads.h:52:23: bits/gthr.h: No such
file or directory
In file included from F:/Dev-Cpp/include/c++/bits/stl_alloc.h:86,
from F:/Dev-Cpp/include/c++/memory:55,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/stl_threads.h: At global scope:
F:/Dev-Cpp/include/c++/bits/stl_threads.h:69: '__gthread_mutex_t' is
used as a
type, but is not defined as a type.
F:/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 lib...@gc....
F:/Dev-Cpp/include/c++/bits/stl_threads.h: In member function `void
std::_Refcount_Base::_M_incr()':
F:/Dev-Cpp/include/c++/bits/stl_threads.h:86: `_M_ref_count_lock'
undeclared
(first use this function)
F:/Dev-Cpp/include/c++/bits/stl_threads.h:86: `__gthread_mutex_lock'
undeclared
(first use this function)
F:/Dev-Cpp/include/c++/bits/stl_threads.h:88: `__gthread_mutex_unlock'
undeclared (first use this function)
F:/Dev-Cpp/include/c++/bits/stl_threads.h: At global scope:
F:/Dev-Cpp/include/c++/bits/stl_threads.h:158: '__gthread_mutex_t' is
used as a
type, but is not defined as a type.
F:/Dev-Cpp/include/c++/bits/stl_threads.h: In member function `void
std::_STL_mutex_lock::_M_acquire_lock()':
F:/Dev-Cpp/include/c++/bits/stl_threads.h:192: `_M_lock' undeclared
(first use
this function)
In file included from F:/Dev-Cpp/include/c++/memory:55,
from F:/Dev-Cpp/include/c++/string:48,
from F:/Dev-Cpp/include/c++/bits/localefwd.h:49,
from F:/Dev-Cpp/include/c++/ios:48,
from F:/Dev-Cpp/include/c++/ostream:45,
from F:/Dev-Cpp/include/c++/iostream:45,
from D:/Documents and Settings/Dany/My
Documents/test.cpp:1:
F:/Dev-Cpp/include/c++/bits/stl_alloc.h: At global scope:
F:/Dev-Cpp/include/c++/bits/stl_alloc.h:575: syntax error before `;'
token
F:/Dev-Cpp/include/c++/bits/stl_alloc.h:575: confused by earlier errors,
bailing out Execution terminated
<end quote compile log>
--
This mail is a natural product. The slight variations in
spelling and grammar enhance its individual character and
beauty and in no way are to be considered flaws or defects.
|
|
From: Ioannis V. <no...@ho...> - 2003-01-16 06:53:11
|
------Original Message-------=0D
=0D
From: Dany P. Wu=0D
Date: Thursday, 16 January 2003 7:38:20 AM=0D
To: dev...@li...=0D
Subject: [Dev-C++] Compiling problems with 4.9.7.0 and GCC 3.2=0D
=0D
Hi everyone,=0D
=0D
This problem has probably come up for discussion numerous times before.=0D
It's certainly puzzled me to no end, being a learner at this whole C++=0D
business.=0D
=0D
I figured, by looking in the include directory, that I should use=0D
iostream instead of iostream.h=0D
=0D
That much seemed obvious but when I typed this typical beginner's code:=0D
=0D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D
#include <iostream>=0D
=0D
main()=0D
=0D
=3D=3D> int main()=0D
=0D
{=0D
=3D=3D>std::cout << "Hello world!";=0D
return(0);=0D
}=0D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D
=0D
I got some humangous amount of errors, 70 I think. I apologise for the=0D
length of this log but I thought I better include it for the sake of=0D
completion. You guys probably know this already.=0D
=0D
The question is, where have I gone wrong? What's happening here? Any=0D
help would be immensely appreciated.=0D
=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20
|
|
From: <cg...@wo...> - 2003-01-16 10:57:52
|
If you use iostream instead iostream.h you must:
1) Add using namespace std; before main or as its first line
2) Each time you use a function or name from it you have to write std::
just before it, in your example: std::cout
The use of iostream.h is considered deprecated, so if you want use it it
would be more comfortable if you add the compiler option
-Wno-deprecated, so the compiler won't send you a very long warning
about it.
Dany P. Wu wrote:
>Hi everyone,
>
>This problem has probably come up for discussion numerous times before.
>It's certainly puzzled me to no end, being a learner at this whole C++
>business.
>
>I figured, by looking in the include directory, that I should use
>iostream instead of iostream.h
>
>That much seemed obvious but when I typed this typical beginner's code:
>
>==================================
>#include <iostream>
>
>main()
>{
> cout << "Hello world!";
> return(0);
>}
>==================================
>
>
|