* Re: Compiling a program
@ 2003-07-24 7:18 Wayne
2003-07-30 14:55 ` LLeweLLyn Reese
0 siblings, 1 reply; 6+ messages in thread
From: Wayne @ 2003-07-24 7:18 UTC (permalink / raw)
To: gcc-help
When you invoke the compiler in that fashion, the
executable you generate will be called a.exe.
If you want to check on your compiler, gcc -v
provides useful output.
Wayne
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling a program
2003-07-24 7:18 Compiling a program Wayne
@ 2003-07-30 14:55 ` LLeweLLyn Reese
0 siblings, 0 replies; 6+ messages in thread
From: LLeweLLyn Reese @ 2003-07-30 14:55 UTC (permalink / raw)
To: Wayne; +Cc: gcc-help
"Wayne" <dockeen@mchsi.com> writes:
> When you invoke the compiler in that fashion, the
> executable you generate will be called a.exe.
[snip]
Nit: unix gcc (including cygwin, I think) create a file named 'a.out',
not 'a.exe'.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling a program
@ 2003-07-25 5:31 Wayne
0 siblings, 0 replies; 6+ messages in thread
From: Wayne @ 2003-07-25 5:31 UTC (permalink / raw)
To: gcc-help
Your code has an issue with it: While you use the correct standard
header notation, you have left out one important detail. cout is
located in the standard namespace, so you either have to add
using namespace std;
to tell the compiler where the name cout is defined or qualify the
name to tell where it comes from, i.e.
std::cout
#include <iostream>
using namespace std;
int main()
{
cout << "Hello";
};
This link will catch you up more fully on standard headers:
http://www.cplusplus.com/doc/ansi/hfiles.html
Wayne
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling a program
2003-07-24 23:12 VANDEMAN, MIKE (SBCSI)
@ 2003-07-25 0:06 ` Miguel Bernal
0 siblings, 0 replies; 6+ messages in thread
From: Miguel Bernal @ 2003-07-25 0:06 UTC (permalink / raw)
To: VANDEMAN, MIKE (SBCSI); +Cc: gcc-help
Hello
i dont know if these can help you
source:
#include <iostream>
int main(int argc, char *argv[])
{
std::cout << "Hello";
};
--- "VANDEMAN, MIKE (SBCSI)" <mv2371@sbc.com> escribió:
> gcc -o tst tst.cpp >tst.out 2>&1
>
> source:
>
> #include <iostream>
>
> int main()
> {
> cout << "Hello";
> };
>
_________________________________________________________
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Compiling a program
@ 2003-07-24 23:12 VANDEMAN, MIKE (SBCSI)
2003-07-25 0:06 ` Miguel Bernal
0 siblings, 1 reply; 6+ messages in thread
From: VANDEMAN, MIKE (SBCSI) @ 2003-07-24 23:12 UTC (permalink / raw)
To: 'gcc-help@gcc.gnu.org'
gcc -o tst tst.cpp >tst.out 2>&1
source:
#include <iostream>
int main()
{
cout << "Hello";
};
iostream:
// -*- C++ -*- std header.
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you
compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _CPP_IOSTREAM
#include <bits/std_iostream.h>
#endif
compile errors:
In file included from /opt/gcc/include/g++-v3/bits/std_iosfwd.h:42,
from /opt/gcc/include/g++-v3/bits/std_ios.h:39,
from /opt/gcc/include/g++-v3/bits/std_ostream.h:39,
from /opt/gcc/include/g++-v3/bits/std_iostream.h:40,
from /opt/gcc/include/g++-v3/backward/iostream.h:32,
from tst.cpp:1:
/opt/gcc/include/g++-v3/bits/functexcept.h:34:31: exception_defines.h: No
such file or directory
In file included from /opt/gcc/include/g++-v3/bits/std_ostream.h:39,
from /opt/gcc/include/g++-v3/bits/std_iostream.h:40,
from /opt/gcc/include/g++-v3/backward/iostream.h:32,
from tst.cpp:1:
/opt/gcc/include/g++-v3/bits/std_ios.h:40:57: exception: No such file or
directory
In file included from /opt/gcc/include/g++-v3/bits/std_memory.h:20,
from /opt/gcc/include/g++-v3/bits/std_string.h:43,
from /opt/gcc/include/g++-v3/bits/localefwd.h:42,
from /opt/gcc/include/g++-v3/bits/std_ios.h:43,
from /opt/gcc/include/g++-v3/bits/std_ostream.h:39,
from /opt/gcc/include/g++-v3/bits/std_iostream.h:40,
from /opt/gcc/include/g++-v3/backward/iostream.h:32,
from tst.cpp:1:
/opt/gcc/include/g++-v3/bits/stl_algobase.h:46:15: new: No such file or
directory
In file included from /opt/gcc/include/g++-v3/bits/stl_alloc.h:28,
from /opt/gcc/include/g++-v3/bits/std_memory.h:21,
from /opt/gcc/include/g++-v3/bits/std_string.h:43,
from /opt/gcc/include/g++-v3/bits/localefwd.h:42,
from /opt/gcc/include/g++-v3/bits/std_ios.h:43,
from /opt/gcc/include/g++-v3/bits/std_ostream.h:39,
from /opt/gcc/include/g++-v3/bits/std_iostream.h:40,
from /opt/gcc/include/g++-v3/backward/iostream.h:32,
from tst.cpp:1:
/opt/gcc/include/g++-v3/bits/functexcept.h:34:31: exception_defines.h: Error
0
In file included from /opt/gcc/include/g++-v3/bits/std_memory.h:22,
from /opt/gcc/include/g++-v3/bits/std_string.h:43,
from /opt/gcc/include/g++-v3/bits/localefwd.h:42,
from /opt/gcc/include/g++-v3/bits/std_ios.h:43,
from /opt/gcc/include/g++-v3/bits/std_ostream.h:39,
from /opt/gcc/include/g++-v3/bits/std_iostream.h:40,
from /opt/gcc/include/g++-v3/backward/iostream.h:32,
from tst.cpp:1:
/opt/gcc/include/g++-v3/bits/stl_construct.h:34:15: new: Error 0
In file included from /opt/gcc/include/g++-v3/bits/localefwd.h:44,
from /opt/gcc/include/g++-v3/bits/std_ios.h:43,
from /opt/gcc/include/g++-v3/bits/std_ostream.h:39,
from /opt/gcc/include/g++-v3/bits/std_iostream.h:40,
from /opt/gcc/include/g++-v3/backward/iostream.h:32,
from tst.cpp:1:
/opt/gcc/include/g++-v3/bits/functexcept.h:34:31: exception_defines.h: Error
0
In file included from /opt/gcc/include/g++-v3/bits/std_ios.h:44,
from /opt/gcc/include/g++-v3/bits/std_ostream.h:39,
from /opt/gcc/include/g++-v3/bits/std_iostream.h:40,
from /opt/gcc/include/g++-v3/backward/iostream.h:32,
from tst.cpp:1:
/opt/gcc/include/g++-v3/bits/ios_base.h:146: parse error before `{' token
/opt/gcc/include/g++-v3/bits/ios_base.h:154: destructor `failure' must match
class name `ios_base'
/opt/gcc/include/g++-v3/bits/ios_base.h:228: parse error before `protected'
/opt/gcc/include/g++-v3/bits/ios_base.h:240: syntax error before `;' token
/opt/gcc/include/g++-v3/bits/ios_base.h:244: parse error before `,' token
/opt/gcc/include/g++-v3/bits/ios_base.h:246: missing ';' before right brace
/opt/gcc/include/g++-v3/bits/ios_base.h:248: semicolon missing after
declaration of `std::_Callback_list'
/opt/gcc/include/g++-v3/bits/ios_base.h:249: ISO C++ forbids defining types
within return type
/opt/gcc/include/g++-v3/bits/ios_base.h:249: two or more data types in
declaration of `_M_add_reference'
/opt/gcc/include/g++-v3/bits/ios_base.h:249: semicolon missing after
declaration of `struct std::_Callback_list'
/opt/gcc/include/g++-v3/bits/ios_base.h: In function `int
std::_M_add_reference()':
/opt/gcc/include/g++-v3/bits/ios_base.h:249: `_M_refcount' undeclared (first
use this function)
/opt/gcc/include/g++-v3/bits/ios_base.h:249: (Each undeclared identifier is
reported only once for each function it appears in.)
/opt/gcc/include/g++-v3/bits/ios_base.h: At global scope:
/opt/gcc/include/g++-v3/bits/ios_base.h:255: syntax error before `*' token
/opt/gcc/include/g++-v3/bits/ios_base.h:258: `event' was not declared in
this
scope
/opt/gcc/include/g++-v3/bits/ios_base.h:258: parse error before `)' token
/opt/gcc/include/g++-v3/bits/ios_base.h:280: 'locale' is used as a type, but
is
not defined as a type.
/opt/gcc/include/g++-v3/bits/ios_base.h:285: parse error before `public'
/opt/gcc/include/g++-v3/bits/ios_base.h:296: destructors must be member
functions
/opt/gcc/include/g++-v3/bits/ios_base.h:304: parse error before `private'
/opt/gcc/include/g++-v3/bits/ios_base.h:307: parse error before `}' token
/opt/gcc/include/g++-v3/bits/ios_base.h:311: syntax error before `(' token
/opt/gcc/include/g++-v3/bits/ios_base.h:314: syntax error before `(' token
/opt/gcc/include/g++-v3/bits/ios_base.h:317: `__fmtfl' was not declared in
this
scope
/opt/gcc/include/g++-v3/bits/ios_base.h:318: parse error before `return'
/opt/gcc/include/g++-v3/bits/ios_base.h:322: syntax error before `(' token
/opt/gcc/include/g++-v3/bits/ios_base.h:325: syntax error before `|=' token
/opt/gcc/include/g++-v3/bits/ios_base.h:330: syntax error before `(' token
/opt/gcc/include/g++-v3/bits/ios_base.h:333: syntax error before `&=' token
/opt/gcc/include/g++-v3/bits/ios_base.h:334: syntax error before `|=' token
/opt/gcc/include/g++-v3/bits/ios_base.h:339: `fmtflags' was not declared in
this scope
/opt/gcc/include/g++-v3/bits/ios_base.h:339: parse error before `)' token
/opt/gcc/include/g++-v3/bits/ios_base.h: In function `void unsetf(...)':
/opt/gcc/include/g++-v3/bits/ios_base.h:339: `__mask' undeclared (first use
this function)
/opt/gcc/include/g++-v3/bits/ios_base.h: At global scope:
/opt/gcc/include/g++-v3/bits/ios_base.h:342: syntax error before `(' token
/opt/gcc/include/g++-v3/bits/ios_base.h:345: syntax error before `(' token
/opt/gcc/include/g++-v3/bits/ios_base.h:348: `__prec' was not declared in
this
scope
/opt/gcc/include/g++-v3/bits/ios_base.h:349: parse error before `return'
/opt/gcc/include/g++-v3/bits/ios_base.h:353: syntax error before `(' token
/opt/gcc/include/g++-v3/bits/ios_base.h:356: syntax error before `(' token
/opt/gcc/include/g++-v3/bits/ios_base.h:359: `__wide' was not declared in
this
scope
/opt/gcc/include/g++-v3/bits/ios_base.h:360: parse error before `return'
/opt/gcc/include/g++-v3/bits/ios_base.h:368: parse error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:371: syntax error before `(' token
/opt/gcc/include/g++-v3/bits/ios_base.h:394: destructors must be member
functions
/opt/gcc/include/g++-v3/bits/ios_base.h:396: parse error before `protected'
/opt/gcc/include/g++-v3/bits/ios_base.h:403: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:409: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:416: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:423: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:430: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:437: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:444: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:451: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:458: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:465: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:472: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:479: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:486: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:493: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:500: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:508: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:515: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:522: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:530: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:537: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:544: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:552: syntax error before `&' token
/opt/gcc/include/g++-v3/bits/ios_base.h:559: syntax error before `&' token
In file included from /opt/gcc/include/g++-v3/bits/std_ios.h:45,
from /opt/gcc/include/g++-v3/bits/std_ostream.h:39,
from /opt/gcc/include/g++-v3/bits/std_iostream.h:40,
from /opt/gcc/include/g++-v3/backward/iostream.h:32,
from tst.cpp:1:
/opt/gcc/include/g++-v3/bits/std_streambuf.h:111: syntax error before `;'
token
/opt/gcc/include/g++-v3/bits/std_streambuf.h:114: data member
`_M_buf_locale'
cannot be a member template
/opt/gcc/include/g++-v3/bits/std_streambuf.h:117: data member
`_M_buf_locale_init' cannot be a member template
/opt/gcc/include/g++-v3/bits/std_streambuf.h:124: data member
`_M_pback_size'
cannot be a member template
/opt/gcc/include/g++-v3/bits/std_streambuf.h:125: data member `_M_pback'
cannot
be a member template
/opt/gcc/include/g++-v3/bits/std_streambuf.h:126: data member
`_M_pback_cur_save' cannot be a member template
/opt/gcc/include/g++-v3/bits/std_streambuf.h:127: data member
`_M_pback_end_save' cannot be a member template
/opt/gcc/include/g++-v3/bits/std_streambuf.h:128: data member
`_M_pback_init'
cannot be a member template
/opt/gcc/include/g++-v3/bits/std_streambuf.h:135: default argument for
template
parameter in function template `void std::ios_base::_M_pback_create()'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:135: template definition of
non-template `void std::ios_base::_M_pback_create()'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:306: type specifier omitted for
parameter
/opt/gcc/include/g++-v3/bits/std_streambuf.h:306: parse error before `,'
token
/opt/gcc/include/g++-v3/bits/std_streambuf.h:308: template definition of
non-template `typename _Traits::pos_type std::ios_base::pubseekoff(...)'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:312: type specifier omitted for
parameter
/opt/gcc/include/g++-v3/bits/std_streambuf.h:312: parse error before `='
token
/opt/gcc/include/g++-v3/bits/std_streambuf.h:313: template definition of
non-template `typename _Traits::pos_type std::ios_base::pubseekpos(...)'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:451: type specifier omitted for
parameter
/opt/gcc/include/g++-v3/bits/std_streambuf.h:452: type specifier omitted for
parameter
/opt/gcc/include/g++-v3/bits/std_streambuf.h:453: template definition of
non-template `virtual typename _Traits::pos_type
std::ios_base::seekoff(typename _Traits::off_type)'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:457: type specifier omitted for
parameter
/opt/gcc/include/g++-v3/bits/std_streambuf.h:458: template definition of
non-template `virtual typename _Traits::pos_type
std::ios_base::seekpos(typename _Traits::pos_type)'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:135: template definition of
non-template `void std::basic_streambuf<_CharT,
_Traits>::_M_pback_create()'
/opt/gcc/include/g++-v3/bits/std_streambuf.h: In member function `void
std::basic_streambuf<_CharT, _Traits>::_M_pback_create()':
/opt/gcc/include/g++-v3/bits/std_streambuf.h:138: parse error before `;'
token
/opt/gcc/include/g++-v3/bits/std_streambuf.h: At global scope:
/opt/gcc/include/g++-v3/bits/std_streambuf.h:308: template definition of
non-template `typename _Traits::pos_type std::basic_streambuf<_CharT,
_Traits>::pubseekoff(...)'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:313: template definition of
non-template `typename _Traits::pos_type std::basic_streambuf<_CharT,
_Traits>::pubseekpos(...)'
/opt/gcc/include/g++-v3/bits/std_streambuf.h: In constructor
`std::basic_streambuf<_CharT, _Traits>::basic_streambuf()':
/opt/gcc/include/g++-v3/bits/std_streambuf.h:385: class
`std::basic_streambuf<_CharT, _Traits>' does not have any field named
`_M_mode'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:385: class
`std::basic_streambuf<_CharT, _Traits>' does not have any field named
`_M_buf_locale'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:386: class
`std::basic_streambuf<_CharT, _Traits>' does not have any field named
`_M_buf_locale_init'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:386: class
`std::basic_streambuf<_CharT, _Traits>' does not have any field named
`_M_pback_size'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:386: class
`std::basic_streambuf<_CharT, _Traits>' does not have any field named
`_M_pback'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:387: class
`std::basic_streambuf<_CharT, _Traits>' does not have any field named
`_M_pback_cur_save'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:387: class
`std::basic_streambuf<_CharT, _Traits>' does not have any field named
`_M_pback_end_save'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:387: class
`std::basic_streambuf<_CharT, _Traits>' does not have any field named
`_M_pback_init'
/opt/gcc/include/g++-v3/bits/std_streambuf.h: At global scope:
/opt/gcc/include/g++-v3/bits/std_streambuf.h:453: template definition of
non-template `virtual typename _Traits::pos_type
std::basic_streambuf<_CharT, _Traits>::seekoff(typename
_Traits::off_type)'
/opt/gcc/include/g++-v3/bits/std_streambuf.h:458: template definition of
non-template `virtual typename _Traits::pos_type
std::basic_streambuf<_CharT, _Traits>::seekpos(typename
_Traits::pos_type)'
In file included from /opt/gcc/include/g++-v3/bits/std_streambuf.h:529,
from /opt/gcc/include/g++-v3/bits/std_ios.h:45,
from /opt/gcc/include/g++-v3/bits/std_ostream.h:39,
from /opt/gcc/include/g++-v3/bits/std_iostream.h:40,
from /opt/gcc/include/g++-v3/backward/iostream.h:32,
from tst.cpp:1:
/opt/gcc/include/g++-v3/bits/streambuf.tcc: In function `streamsize
std::__copy_streambufs(std::basic_ios<_CharT, _Traits>&,
std::basic_streambuf<_CharT, _Traits>*, std::basic_streambuf<_CharT,
_Traits>*)':
/opt/gcc/include/g++-v3/bits/streambuf.tcc:221: parse error before `&' token
/opt/gcc/include/g++-v3/bits/streambuf.tcc:224: confused by earlier errors,
bailing out
^ permalink raw reply [flat|nested] 6+ messages in thread
* Compiling a program
@ 2003-07-23 23:13 VANDEMAN, MIKE (SBCSI)
0 siblings, 0 replies; 6+ messages in thread
From: VANDEMAN, MIKE (SBCSI) @ 2003-07-23 23:13 UTC (permalink / raw)
To: 'gcc-help@gcc.gnu.org'
"gcc tst.cpp" gave no output whatsoever. What am I doing wrong?
Mike Vandeman
925-901-7270
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-07-30 14:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-24 7:18 Compiling a program Wayne
2003-07-30 14:55 ` LLeweLLyn Reese
-- strict thread matches above, loose matches on Subject: below --
2003-07-25 5:31 Wayne
2003-07-24 23:12 VANDEMAN, MIKE (SBCSI)
2003-07-25 0:06 ` Miguel Bernal
2003-07-23 23:13 VANDEMAN, MIKE (SBCSI)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).