|
From: jansb000 <jan...@pl...> - 2002-08-06 21:24:59
|
I feel a bit silly but somehow I seem to have forgotten a basic setting = in DEVC++. When I create a new project, using the templates for a console = application, I can compile and run without any problem. (Note: the = template contains the most simple main() with no functionality except = waiting for a keypress). Next when I add one line to main(): cout << "Hello world\n"; then compiling is ok but linking doesn't work anymore. I get the = message: [linker error] undefined reference to 'cout' Is there a library that I have to include? How does this work? |
|
From: Jim W. <ma...@em...> - 2002-08-06 21:42:02
|
#include <iostream.h> ;-) -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of jansb000 Sent: Tuesday, August 06, 2002 5:25 PM To: Dev-C++ Subject: [Dev-C++] Stupid question I feel a bit silly but somehow I seem to have forgotten a basic setting in DEVC++. When I create a new project, using the templates for a console application, I can compile and run without any problem. (Note: the template contains the most simple main() with no functionality except waiting for a keypress). Next when I add one line to main(): cout << "Hello world\n"; then compiling is ok but linking doesn't work anymore. I get the message: [linker error] undefined reference to 'cout' Is there a library that I have to include? How does this work? |
|
From: Ioannis V. <no...@ho...> - 2002-08-07 06:13:32
|
<http://run.to/noicys> -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Jim Watters Sent: Wednesday, August 07, 2002 12:42 AM To: dev...@li... Subject: RE: [Dev-C++] Stupid question #include <iostream.h> ;-) #include <iostream> // ... using namespace std; :) Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net <http://www.noicys.cjb.net/> * Alternative URL: http://run.to/noicys |
|
From: Jim W. <ma...@em...> - 2002-08-07 13:11:36
|
-----Original Message----- From: Jim Watters #include <iostream.h> ;-) -----Original Message----- From: Ioannis Vranos #include <iostream> using namespace std; :) -----New Message----- You mean :) must be used instead of ;-)? Thanks. I'm used to C and doing things "the old way". :) Jim |
|
From: Ioannis V. <no...@ho...> - 2002-08-07 14:37:32
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Jim Watters > Sent: Wednesday, August 07, 2002 4:11 PM > To: dev...@li... > Subject: RE: [Dev-C++] Stupid question > > > -----Original Message----- > From: Jim Watters > > #include <iostream.h> > > ;-) > > -----Original Message----- > From: Ioannis Vranos > > #include <iostream> > > using namespace std; > > :) > > -----New Message----- > > You mean :) must be used instead of ;-)? Something like that. :)) > Thanks. I'm used to C and doing things "the old way". You mean to C and pre-ANSI C++ (because C has nothing to do with that).. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys |
|
From: Jim W. <ma...@em...> - 2002-08-07 14:53:02
|
Argh! :) can be overloaded? Exactly, the books I'm studying from are old, but I have seen references to omitting the header extension and using namespaces in (ANSI/ISO) C++. :)) Jim -----Original Message----- From: Ioannis Vranos > You mean :) must be used instead of ;-)? Something like that. :)) > Thanks. I'm used to C and doing things "the old way". You mean to C and pre-ANSI C++ (because C has nothing to do with that).. |
|
From: Ioannis V. <no...@ho...> - 2002-08-07 15:31:46
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Jim Watters > Sent: Wednesday, August 07, 2002 5:53 PM > To: dev...@li... > Subject: RE: [Dev-C++] Stupid question > > > > Argh! :) can be overloaded? > > Exactly, the books I'm studying from are old, but I have seen > references > to omitting the header extension and using namespaces in > (ANSI/ISO) C++. Well i happened to start learning C++ with an outdated book too. I recommend to read "The C++ Programming Language" 3rd Edition or Special Edition by Bjarne Stroustrup (the creator of C++) after you finish with your introductory book(s). It will be much pain to read it cover to cover, but this is the cost of becoming an expert. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys |
|
From: Jim W. <ma...@em...> - 2002-08-07 15:58:07
|
Thank you again. I have the 2nd edition of the book (1991) which does not cover namespaces, but recently purchased "Beginning Visual C++ 6" by Ivor Horton which is shaping up to be an excellent resource on both C++ and general Windows programming. Give me a few months and I'll not be such a C++ newbie. (:) <= encapsulated http://www.bookpool.com/.x/dcoe46d6b8/sm/186100088X Jim Watters -----Original Message----- From: Ioannis Vranos I recommend to read "The C++ Programming Language" 3rd Edition or Special Edition by Bjarne Stroustrup (the creator of C++) after you finish with your introductory book(s). It will be much pain to read it cover to cover, but this is the cost of becoming an expert. |
|
From: Ioannis V. <no...@ho...> - 2002-08-07 17:42:54
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Jim Watters > Sent: Wednesday, August 07, 2002 6:58 PM > To: dev...@li... > Subject: RE: [Dev-C++] Stupid question > > > > Thank you again. > > I have the 2nd edition of the book (1991) which does not cover > namespaces, Ahh, it's unfortunate but it is close to useless. C++ has become quite different since then. You have to get the 3rd or special edition... > but recently purchased "Beginning Visual C++ 6" by Ivor > Horton which is shaping up to be an excellent resource on both C++ and > general Windows programming. Give me a few months and I'll > not be such a > C++ newbie. (:) <= encapsulated Visual C++ 6 is very old and not ANSI C++ compliant... You should learn about VC++ 7 .NET (that's what i am also learning this time). From the series of those books, i have the "Beginning Visual Basic 6" which is useless too (VB 7 .NET is quite different than 6). Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys |
|
From: jansb000 <jan...@pl...> - 2002-08-09 21:16:03
|
This is my program: I still have the problem ([linker error] undefined
reference to 'cout')!
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(int argc, char *argv[]) {
cout << "hello" << "\n";
system("PAUSE");
return 0;
}
----- Original Message -----
From: "Jim Watters" <ma...@em...>
To: <dev...@li...>
Sent: Wednesday, August 07, 2002 3:11 PM
Subject: RE: [Dev-C++] Stupid question
> -----Original Message-----
> From: Jim Watters
>
> #include <iostream.h>
>
> ;-)
>
> -----Original Message-----
> From: Ioannis Vranos
>
> #include <iostream>
>
> using namespace std;
>
> :)
>
> -----New Message-----
>
> You mean :) must be used instead of ;-)?
>
> Thanks. I'm used to C and doing things "the old way".
>
> :)
>
> Jim
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Rob <ro...@us...> - 2002-08-09 21:32:26
|
I pasted your code into a blank file and compiled/executed it without
problem.
Rob
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...]On Behalf Of jansb000
> Sent: Friday, August 09, 2002 4:16 PM
> To: Jim Watters; dev...@li...
> Subject: Re: [Dev-C++] Stupid question
>
>
> This is my program: I still have the problem ([linker error] undefined
> reference to 'cout')!
>
> #include <iostream>
> #include <stdlib.h>
>
> using namespace std;
>
> int main(int argc, char *argv[]) {
> cout << "hello" << "\n";
> system("PAUSE");
> return 0;
> }
>
> ----- Original Message -----
> From: "Jim Watters" <ma...@em...>
> To: <dev...@li...>
> Sent: Wednesday, August 07, 2002 3:11 PM
> Subject: RE: [Dev-C++] Stupid question
>
>
> > -----Original Message-----
> > From: Jim Watters
> >
> > #include <iostream.h>
> >
> > ;-)
> >
> > -----Original Message-----
> > From: Ioannis Vranos
> >
> > #include <iostream>
> >
> > using namespace std;
> >
> > :)
> >
> > -----New Message-----
> >
> > You mean :) must be used instead of ;-)?
> >
> > Thanks. I'm used to C and doing things "the old way".
> >
> > :)
> >
> > Jim
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Ioannis V. <no...@ho...> - 2002-08-09 21:53:36
|
Your code is valid, you should not get any errors, although it could be
written better:
#include <iostream>
#include <cstdlib>
int main() {
using namespace std;
cout << "hello" << "\n";
system("PAUSE");
return 0;
}
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of jansb000
> Sent: Saturday, August 10, 2002 12:16 AM
> To: Jim Watters; dev...@li...
> Subject: Re: [Dev-C++] Stupid question
>
>
> This is my program: I still have the problem ([linker error] undefined
> reference to 'cout')!
>
> #include <iostream>
> #include <stdlib.h>
>
> using namespace std;
>
> int main(int argc, char *argv[]) {
> cout << "hello" << "\n";
> system("PAUSE");
> return 0;
> }
>
> ----- Original Message -----
> From: "Jim Watters" <ma...@em...>
> To: <dev...@li...>
> Sent: Wednesday, August 07, 2002 3:11 PM
> Subject: RE: [Dev-C++] Stupid question
>
>
> > -----Original Message-----
> > From: Jim Watters
> >
> > #include <iostream.h>
> >
> > ;-)
> >
> > -----Original Message-----
> > From: Ioannis Vranos
> >
> > #include <iostream>
> >
> > using namespace std;
> >
> > :)
> >
> > -----New Message-----
> >
> > You mean :) must be used instead of ;-)?
> >
> > Thanks. I'm used to C and doing things "the old way".
> >
> > :)
> >
> > Jim
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Zodiaq <zo...@ac...> - 2002-08-09 22:40:33
|
Hello Ioannis and all Dev-C++ users,
Friday, August 9, 2002, 11:53:12 PM, Ioannis wrote as follows:
IV> Your code is valid, you should not get any errors, although it could be
IV> written better:
IV> #include <iostream>
IV> #include <cstdlib>
IV> int main() {
IV> using namespace std;
IV> cout << "hello" << "\n";
IV> system("PAUSE");
Ain't that better to use cin.ignore() instead of cstdlib and
system("PAUSE") ??
IV> return 0;
IV> }
IV> Ioannis
IV> * Ioannis Vranos
IV> * Programming pages: http://www.noicys.cjb.net
IV> * Alternative URL: http://run.to/noicys
that are just my two grosze...
--
regards, Zodiaq
|
|
From: Ioannis V. <no...@ho...> - 2002-08-09 22:46:09
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf Of Zodiaq
> Sent: Saturday, August 10, 2002 1:40 AM
> To: Dev...@li...
> Subject: Re[2]: [Dev-C++] Stupid question
>
>
> Hello Ioannis and all Dev-C++ users,
>
> Friday, August 9, 2002, 11:53:12 PM, Ioannis wrote as follows:
>
> IV> Your code is valid, you should not get any errors,
> although it could be
> IV> written better:
>
> IV> #include <iostream>
> IV> #include <cstdlib>
>
>
> IV> int main() {
>
> IV> using namespace std;
>
> IV> cout << "hello" << "\n";
> IV> system("PAUSE");
>
> Ain't that better to use cin.ignore() instead of cstdlib and
> system("PAUSE") ??
Yes that would be more portable.
> that are just my two grosze...
> --
> regards, Zodiaq
Ioannis hands to Zodiaq 2 euro-grosze.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
|