* c++ question
@ 2002-12-25 13:30 John Burski
2002-12-25 16:22 ` Alexander Helm
0 siblings, 1 reply; 12+ messages in thread
From: John Burski @ 2002-12-25 13:30 UTC (permalink / raw)
To: SCALUG, gcc-help
[-- Attachment #1: Type: text/plain, Size: 1955 bytes --]
I'm sitting here on Christmas day with not a lot to do until later, so I
decided I'd see if I could "sharpen the saw" a bit an work on a bit of
C++ (it has been a long time since I wrote any C++, but I've used it
before). However, to my astonishment and dismay, I can compile from
"program.cpp" to "program.o", but I can't link "program.o" to make
"program". So, I decided to return to my "roots", if you will, and
write a simple little C++ program named "hello" that simply displays
"Hello, World!" in a terminal window (I've attached the source file).
OK, before I go any further, I'm running Red Hat 8.0 (I installed
EVERYTHING - yes, it was a huge install, but I had plenty of room). The
complier is the GNU compiler that came with the install (gcc version 3.2).
I made a series of "Makefiles" to better document my travails. The
first one, "Makefile1", I expected to fail -- and it did (results of the
"make -f Makefile1" command are in "make1.txt"). The results indicated
that I needed to link to the library that contains "cout" and "ostream".
So I proceded to try "Makefile2", the results of which are in "make2.txt".
Becoming a bit frustrated, I built a script that created a combined
table of contents of every ".a" file located in the "/usr/lib"
directory. A quick search of the resulting file shows no instance of an
"ostream.o" object in any of the libraries. Digging a bit deeper into
the /usr/lib directory tree, I found /usr/lib/gcc-lib. So I followed it
down to "/usr/lib/gcc-lib/i386-redhat-linux/3.2". I added this
directory to my /etc/ld.so.conf file and ran ldconfig. I created
"Makefile3", the results of which are in "make3.txt". Since that didn't
work, I created "Makefile4", the results of which are in "make4.txt".
I'm at a loss -- where should I be looking for the proper link libraries?
--
John Burski
@HOME S.I.M.U. (Well, sometimes I am :) )
... and still searching for the cheese!
[-- Attachment #2: hello.cpp --]
[-- Type: text/plain, Size: 86 bytes --]
// File: hello.cpp
#include <iostream>
int main()
{
cout << "Hello, World\n";
}
[-- Attachment #3: Makefile1 --]
[-- Type: text/plain, Size: 117 bytes --]
INCLUDE = /usr/include/g++-3
hello: hello.o
g++ -ohello hello.o
hello.o: hello.cpp
g++ -c -I$(INCLUDE) hello.cpp
[-- Attachment #4: make1.txt --]
[-- Type: text/plain, Size: 1641 bytes --]
Script started on Wed Dec 25 13:04:58 2002
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$
[jburski@natasha c++]$ m
[jburski@natasha c++]$ m
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile1
[jburski@natasha c++]$ make -f Makefile1
g++ -ohello hello.o
hello.o: In function `main':
hello.o(.text+0x19): undefined reference to `cout'
hello.o(.text+0x1e): undefined reference to `ostream::operator<<(char const*)'
collect2: ld returned 1 exit status
make: *** [hello] Error 1
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$ exit
Script done on Wed Dec 25 13:05:09 2002
[-- Attachment #5: Makefile2 --]
[-- Type: text/plain, Size: 163 bytes --]
INCLUDE = /usr/include/g++-3
LIBES = -lstdc++-3-libc6.2-2-2.10.0
hello: hello.o
g++ -o hello hello.o $(LIBES)
hello.o: hello.cpp
g++ -c -I$(INCLUDE) hello.cpp
[-- Attachment #6: make2.txt --]
[-- Type: text/plain, Size: 1619 bytes --]
Script started on Wed Dec 25 13:11:24 2002
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$
[jburski@natasha c++]$ m
[jburski@natasha c++]$ m
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile2
[jburski@natasha c++]$ make -f Makefile2
g++ -o hello hello.o -lstdc++-3-libc6.2-2-2.10.0
hello.o: In function `main':
hello.o(.text+0x1e): undefined reference to `ostream::operator<<(char const*)'
collect2: ld returned 1 exit status
make: *** [hello] Error 1
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$ exit
Script done on Wed Dec 25 13:11:33 2002
[-- Attachment #7: Makefile3 --]
[-- Type: text/plain, Size: 141 bytes --]
INCLUDE = /usr/include/g++-3
LIBES = -lgcc
hello: hello.o
g++ -o hello hello.o $(LIBES)
hello.o: hello.cpp
g++ -c -I$(INCLUDE) hello.cpp
[-- Attachment #8: make3.txt --]
[-- Type: text/plain, Size: 1789 bytes --]
Script started on Wed Dec 25 14:13:07 2002
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$
[jburski@natasha c++]$ m
[jburski@natasha c++]$ m
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mad
[jburski@natasha c++]$ make -f Mad
[jburski@natasha c++]$ make -f Ma^[[K
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile3
[jburski@natasha c++]$ make -f Makefile3
g++ -o hello hello.o -lgcc
hello.o: In function `main':
hello.o(.text+0x19): undefined reference to `cout'
hello.o(.text+0x1e): undefined reference to `ostream::operator<<(char const*)'
collect2: ld returned 1 exit status
make: *** [hello] Error 1
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$ exit
Script done on Wed Dec 25 14:13:55 2002
[-- Attachment #9: Makefile4 --]
[-- Type: text/plain, Size: 144 bytes --]
INCLUDE = /usr/include/g++-3
LIBES = -lstdc++
hello: hello.o
g++ -o hello hello.o $(LIBES)
hello.o: hello.cpp
g++ -c -I$(INCLUDE) hello.cpp
[-- Attachment #10: make4.txt --]
[-- Type: text/plain, Size: 1651 bytes --]
Script started on Wed Dec 25 14:17:31 2002
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$
[jburski@natasha c++]$ m
[jburski@natasha c++]$ m
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile4
[jburski@natasha c++]$ make -f Makefile4
g++ -o hello hello.o -lstdc++
hello.o: In function `main':
hello.o(.text+0x19): undefined reference to `cout'
hello.o(.text+0x1e): undefined reference to `ostream::operator<<(char const*)'
collect2: ld returned 1 exit status
make: *** [hello] Error 1
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$ exit
Script done on Wed Dec 25 14:17:42 2002
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: c++ question
2002-12-25 13:30 c++ question John Burski
@ 2002-12-25 16:22 ` Alexander Helm
2002-12-26 2:26 ` LLeweLLyn Reese
0 siblings, 1 reply; 12+ messages in thread
From: Alexander Helm @ 2002-12-25 16:22 UTC (permalink / raw)
To: John Burski; +Cc: SCALUG, gcc-help
Hi John,
John Burski wrote:
> [...]
> // File: hello.cpp
>
> #include <iostream>
using namespace std;
>
> int main()
> {
> cout << "Hello, World\n";
> }
> [...]
If you add the above line everything should do fine (alternativly you
can use std::cout instead of cout)
> [...]
> INCLUDE = /usr/include/g++-3
> LIBES = -lstdc++-3-libc6.2-2-2.10.0
>
> hello: hello.o
> g++ -o hello hello.o $(LIBES)
>
> hello.o: hello.cpp
> g++ -c -I$(INCLUDE) hello.cpp
I would urge you not to include system-libraries this way, it makes your
source less portable.
CU
Alexander
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: c++ question
2002-12-25 16:22 ` Alexander Helm
@ 2002-12-26 2:26 ` LLeweLLyn Reese
2002-12-26 9:17 ` Matt Juszczak
2002-12-26 10:39 ` [SCALUG] " John Burski
0 siblings, 2 replies; 12+ messages in thread
From: LLeweLLyn Reese @ 2002-12-26 2:26 UTC (permalink / raw)
To: Alexander Helm; +Cc: John Burski, SCALUG, gcc-help
520075708323-0001@t-online.de (Alexander Helm) writes:
> Hi John,
>
> John Burski wrote:
> > [...]
> > // File: hello.cpp
> > #include <iostream>
>
> using namespace std;
Do you really want to bring in everything in namespace std? Like
'count' and 'y1'? I don't think so.
using std::cout;
will bring in only cout. It's better to use individual using statements.
>
> > int main() {
> > cout << "Hello, World\n";
> > }
> > [...]
>
> If you add the above line everything should do fine (alternativly you
> can use std::cout instead of cout)
>
> > [...]
> > INCLUDE = /usr/include/g++-3
> > LIBES = -lstdc++-3-libc6.2-2-2.10.0
> > hello: hello.o
> > g++ -o hello hello.o $(LIBES)
> > hello.o: hello.cpp
> > g++ -c -I$(INCLUDE) hello.cpp
>
> I would urge you not to include system-libraries this way, it makes
> your source less portable.
>
> CU
> Alexander
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: c++ question
2002-12-26 2:26 ` LLeweLLyn Reese
@ 2002-12-26 9:17 ` Matt Juszczak
2002-12-26 11:25 ` LLeweLLyn Reese
2002-12-26 10:39 ` [SCALUG] " John Burski
1 sibling, 1 reply; 12+ messages in thread
From: Matt Juszczak @ 2002-12-26 9:17 UTC (permalink / raw)
To: gcc-help
Is there a good book that not only brushes up C/C++ skills but also focuses
on Makefiles, etc. (GNU-make, GNU-gcc, autoconf, etc.)
Thanks
-Matt
----- Original Message -----
From: "LLeweLLyn Reese" <llewelly@lifesupport.shutdown.com>
To: "Alexander Helm" <520075708323-0001@t-online.de>
Cc: "John Burski" <jburski@cloudnet.com>; "SCALUG"
<scalug-list@mn-linux.org>; <gcc-help@gcc.gnu.org>
Sent: Wednesday, December 25, 2002 4:28 PM
Subject: Re: c++ question
> 520075708323-0001@t-online.de (Alexander Helm) writes:
>
> > Hi John,
> >
> > John Burski wrote:
> > > [...]
> > > // File: hello.cpp
> > > #include <iostream>
> >
> > using namespace std;
>
> Do you really want to bring in everything in namespace std? Like
> 'count' and 'y1'? I don't think so.
>
> using std::cout;
>
> will bring in only cout. It's better to use individual using statements.
>
> >
> > > int main() {
> > > cout << "Hello, World\n";
> > > }
> > > [...]
> >
> > If you add the above line everything should do fine (alternativly you
> > can use std::cout instead of cout)
> >
> > > [...]
> > > INCLUDE = /usr/include/g++-3
> > > LIBES = -lstdc++-3-libc6.2-2-2.10.0
> > > hello: hello.o
> > > g++ -o hello hello.o $(LIBES)
> > > hello.o: hello.cpp
> > > g++ -c -I$(INCLUDE) hello.cpp
> >
> > I would urge you not to include system-libraries this way, it makes
> > your source less portable.
> >
> > CU
> > Alexander
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [SCALUG] Re: c++ question
2002-12-26 2:26 ` LLeweLLyn Reese
2002-12-26 9:17 ` Matt Juszczak
@ 2002-12-26 10:39 ` John Burski
2002-12-27 8:06 ` Andrea 'fwyzard' Bocci
1 sibling, 1 reply; 12+ messages in thread
From: John Burski @ 2002-12-26 10:39 UTC (permalink / raw)
To: scalug-list; +Cc: gcc-help
[-- Attachment #1: Type: text/plain, Size: 2299 bytes --]
My thanks to those who responded to my question -- I really appreciate
the help.
However, my problem still remains.
Since I received multiple suggestions and I didn't want to discount any,
I created two different source files, "hello0.cpp" and "hello1.cpp"
(sources files are attached). I then created "Makefile[123]" for
compiling and linking "hello0.cpp" and "Makefile[456]" for compiling and
linking "hello1.cpp" (files are attached).
I executed each "Makefile" in turn, the results of which are in the
corresponding "make?.txt" files.
As you can see, when I used "namespace std" I still received results
that seemed to indicate that the appropriate link library was not
included. When I used "std::cout" the results indicated that "cout" was
not declared.
While I was writing this, another thought occured to me, so I created
"hello2.cpp" and "Makefile7", the results of which are in "make7.txt".
Still no joy.
I know I've got to be missing something, but I'm still at a loss for
what it might be.
Thanks again.
LLeweLLyn Reese wrote:
>520075708323-0001@t-online.de (Alexander Helm) writes:
>
>
>
>>Hi John,
>>
>>John Burski wrote:
>>
>>
>>>[...]
>>>// File: hello.cpp
>>>#include <iostream>
>>>
>>>
>>using namespace std;
>>
>>
>
>Do you really want to bring in everything in namespace std? Like
> 'count' and 'y1'? I don't think so.
>
>using std::cout;
>
>will bring in only cout. It's better to use individual using statements.
>
>
>
>>>int main() {
>>> cout << "Hello, World\n";
>>>}
>>>[...]
>>>
>>>
>>If you add the above line everything should do fine (alternativly you
>>can use std::cout instead of cout)
>>
>>
>>
>>>[...]
>>>INCLUDE = /usr/include/g++-3
>>>LIBES = -lstdc++-3-libc6.2-2-2.10.0
>>>hello: hello.o
>>> g++ -o hello hello.o $(LIBES)
>>>hello.o: hello.cpp
>>> g++ -c -I$(INCLUDE) hello.cpp
>>>
>>>
>>I would urge you not to include system-libraries this way, it makes
>>your source less portable.
>>
>> CU
>> Alexander
>>
>>
>
>_______________________________________________
>scalug-list mailing list
>scalug-list@mn-linux.org
>https://mailman.real-time.com/mailman/listinfo/scalug-list
>
>.
>
>
>
--
John Burski
@HOME S.I.M.U. (Well, sometimes I am :) )
... and still searching for the cheese!
[-- Attachment #2: hello0.cpp --]
[-- Type: text/plain, Size: 107 bytes --]
// File: hello.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World\n";
}
[-- Attachment #3: hello1.cpp --]
[-- Type: text/plain, Size: 103 bytes --]
// File: hello.cpp
#include <iostream>
using std::cout;
int main()
{
cout << "Hello, World\n";
}
[-- Attachment #4: Makefile1 --]
[-- Type: text/plain, Size: 148 bytes --]
INCLUDE = /usr/include/g++-3
LIBES = -lgcc
hello0: hello0.o
g++ -o hello0 hello0.o $(LIBES)
hello0.o: hello0.cpp
g++ -c -I$(INCLUDE) hello0.cpp
[-- Attachment #5: Makefile2 --]
[-- Type: text/plain, Size: 151 bytes --]
INCLUDE = /usr/include/g++-3
LIBES = -lstdc++
hello0: hello0.o
g++ -o hello0 hello0.o $(LIBES)
hello0.o: hello0.cpp
g++ -c -I$(INCLUDE) hello0.cpp
[-- Attachment #6: Makefile3 --]
[-- Type: text/plain, Size: 157 bytes --]
INCLUDE = /usr/include/g++-3
LIBES = -lstdc++ -lgcc
hello0: hello0.o
g++ -o hello0 hello0.o $(LIBES)
hello0.o: hello0.cpp
g++ -c -I$(INCLUDE) hello0.cpp
[-- Attachment #7: Makefile4 --]
[-- Type: text/plain, Size: 148 bytes --]
INCLUDE = /usr/include/g++-3
LIBES = -lgcc
hello1: hello1.o
g++ -o hello1 hello1.o $(LIBES)
hello1.o: hello1.cpp
g++ -c -I$(INCLUDE) hello1.cpp
[-- Attachment #8: Makefile5 --]
[-- Type: text/plain, Size: 151 bytes --]
INCLUDE = /usr/include/g++-3
LIBES = -lstdc++
hello1: hello1.o
g++ -o hello1 hello1.o $(LIBES)
hello1.o: hello1.cpp
g++ -c -I$(INCLUDE) hello1.cpp
[-- Attachment #9: Makefile6 --]
[-- Type: text/plain, Size: 157 bytes --]
INCLUDE = /usr/include/g++-3
LIBES = -lstdc++ -lgcc
hello1: hello1.o
g++ -o hello1 hello1.o $(LIBES)
hello1.o: hello1.cpp
g++ -c -I$(INCLUDE) hello1.cpp
[-- Attachment #10: make1.txt --]
[-- Type: text/plain, Size: 3347 bytes --]
Script started on Thu Dec 26 09:18:00 2002
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$
[jburski@natasha c++]$ m
[jburski@natasha c++]$ m
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile1
[jburski@natasha c++]$ make -f Makefile1
g++ -o hello0 hello0.o -lgcc
hello0.o: In function `main':
hello0.o(.text+0x19): undefined reference to `cout'
hello0.o(.text+0x1e): undefined reference to `ostream::operator<<(char const*)'
collect2: ld returned 1 exit status
make: *** [hello0] Error 1
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$ exit
Script done on Thu Dec 26 09:18:22 2002
Script started on Thu Dec 26 09:18:48 2002
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$
[jburski@natasha c++]$ m
[jburski@natasha c++]$ m
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile1
[jburski@natasha c++]$ make -f Makefile1
g++ -c -I/usr/include/g++-3 hello0.cpp
g++ -o hello0 hello0.o -lgcc
hello0.o: In function `main':
hello0.o(.text+0x19): undefined reference to `cout'
hello0.o(.text+0x1e): undefined reference to `ostream::operator<<(char const*)'
collect2: ld returned 1 exit status
make: *** [hello0] Error 1
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$ exit
Script done on Thu Dec 26 09:19:07 2002
[-- Attachment #11: make2.txt --]
[-- Type: text/plain, Size: 1696 bytes --]
Script started on Thu Dec 26 09:19:29 2002
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$
[jburski@natasha c++]$ m
[jburski@natasha c++]$ m
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile2
[jburski@natasha c++]$ make -f Makefile2
g++ -c -I/usr/include/g++-3 hello0.cpp
g++ -o hello0 hello0.o -lstdc++
hello0.o: In function `main':
hello0.o(.text+0x19): undefined reference to `cout'
hello0.o(.text+0x1e): undefined reference to `ostream::operator<<(char const*)'
collect2: ld returned 1 exit status
make: *** [hello0] Error 1
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$ exit
Script done on Thu Dec 26 09:19:45 2002
[-- Attachment #12: make3.txt --]
[-- Type: text/plain, Size: 2393 bytes --]
Script started on Thu Dec 26 09:19:58 2002
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$
[jburski@natasha c++]$ s
[jburski@natasha c++]$ s
[jburski@natasha c++]$ sc
[jburski@natasha c++]$ sc
[jburski@natasha c++]$ scr
[jburski@natasha c++]$ scr
[jburski@natasha c++]$ scri
[jburski@natasha c++]$ scri
[jburski@natasha c++]$ scrip
[jburski@natasha c++]$ scrip
[jburski@natasha c++]$ script
[jburski@natasha c++]$ script
[jburski@natasha c++]$ scrip^[[K
[jburski@natasha c++]$ scrip
[jburski@natasha c++]$ scri^[[K
[jburski@natasha c++]$ scri
[jburski@natasha c++]$ scr^[[K
[jburski@natasha c++]$ scr
[jburski@natasha c++]$ sc^[[K
[jburski@natasha c++]$ sc
[jburski@natasha c++]$ s^[[K
[jburski@natasha c++]$ s
[jburski@natasha c++]$ ^[[K
[jburski@natasha c++]$ \a
[jburski@natasha c++]$
[jburski@natasha c++]$ m
[jburski@natasha c++]$ m
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile3
[jburski@natasha c++]$ make -f Makefile3
g++ -c -I/usr/include/g++-3 hello0.cpp
g++ -o hello0 hello0.o -lstdc++ -lgcc
hello0.o: In function `main':
hello0.o(.text+0x19): undefined reference to `cout'
hello0.o(.text+0x1e): undefined reference to `ostream::operator<<(char const*)'
collect2: ld returned 1 exit status
make: *** [hello0] Error 1
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$ exit
Script done on Thu Dec 26 09:20:33 2002
[-- Attachment #13: make4.txt --]
[-- Type: text/plain, Size: 1502 bytes --]
Script started on Thu Dec 26 09:21:30 2002
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$
[jburski@natasha c++]$ m
[jburski@natasha c++]$ m
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile4
[jburski@natasha c++]$ make -f Makefile4
g++ -c -I/usr/include/g++-3 hello1.cpp
hello1.cpp:4: `cout' not declared
make: *** [hello1.o] Error 1
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$ exit
Script done on Thu Dec 26 09:22:07 2002
[-- Attachment #14: make5.txt --]
[-- Type: text/plain, Size: 1502 bytes --]
Script started on Thu Dec 26 09:23:26 2002
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$
[jburski@natasha c++]$ m
[jburski@natasha c++]$ m
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile5
[jburski@natasha c++]$ make -f Makefile5
g++ -c -I/usr/include/g++-3 hello1.cpp
hello1.cpp:4: `cout' not declared
make: *** [hello1.o] Error 1
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$ exit
Script done on Thu Dec 26 09:23:55 2002
[-- Attachment #15: make6.txt --]
[-- Type: text/plain, Size: 1502 bytes --]
Script started on Thu Dec 26 09:24:37 2002
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$
[jburski@natasha c++]$ m
[jburski@natasha c++]$ m
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile6
[jburski@natasha c++]$ make -f Makefile6
g++ -c -I/usr/include/g++-3 hello1.cpp
hello1.cpp:4: `cout' not declared
make: *** [hello1.o] Error 1
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$ exit
Script done on Thu Dec 26 09:24:46 2002
[-- Attachment #16: hello2.cpp --]
[-- Type: text/plain, Size: 91 bytes --]
// File: hello.cpp
#include <iostream>
int main()
{
std::cout << "Hello, World\n";
}
[-- Attachment #17: Makefile7 --]
[-- Type: text/plain, Size: 157 bytes --]
INCLUDE = /usr/include/g++-3
LIBES = -lstdc++ -lgcc
hello2: hello2.o
g++ -o hello2 hello2.o $(LIBES)
hello2.o: hello2.cpp
g++ -c -I$(INCLUDE) hello2.cpp
[-- Attachment #18: make7.txt --]
[-- Type: text/plain, Size: 1557 bytes --]
Script started on Thu Dec 26 09:45:30 2002
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$
[jburski@natasha c++]$ m
[jburski@natasha c++]$ m
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ ma
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ mak
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f M
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Ma
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Mak
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Make
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makef
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefi
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefil
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile
[jburski@natasha c++]$ make -f Makefile7
[jburski@natasha c++]$ make -f Makefile7
g++ -c -I/usr/include/g++-3 hello2.cpp
hello2.cpp: In function `int main()':
hello2.cpp:7: `cout' undeclared in namespace `std'
make: *** [hello2.o] Error 1
^[]0;jburski@natasha:~/toolkit/postgresql/c++\a
[jburski@natasha c++]$
[jburski@natasha c++]$ exit
Script done on Thu Dec 26 09:45:40 2002
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: c++ question
2002-12-26 9:17 ` Matt Juszczak
@ 2002-12-26 11:25 ` LLeweLLyn Reese
2002-12-27 4:25 ` James Buchanan
0 siblings, 1 reply; 12+ messages in thread
From: LLeweLLyn Reese @ 2002-12-26 11:25 UTC (permalink / raw)
To: Matt Juszczak; +Cc: gcc-help
"Matt Juszczak" <matt@atopia.net> writes:
> Is there a good book that not only brushes up C/C++ skills but also focuses
> on Makefiles, etc. (GNU-make, GNU-gcc, autoconf, etc.)
[snip]
$info make
$info gcc
$info autoconf
:-)
I don't know of a good book on any of make, gcc, or autoconf, except
their respective info documentation. I wish I did. The gnu make
info pages have an excellent tutorial, the autoconf pages a
mediocre tutorial. The gcc info pages are a wonderful reference,
but, I fear, quite confusing to those not already familiar with
its convention.
www.accu.org has excellent book reviews of many, many books, on many
subjects (but mostly on C, C++, and Java.)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: c++ question
2002-12-26 11:25 ` LLeweLLyn Reese
@ 2002-12-27 4:25 ` James Buchanan
2002-12-27 4:56 ` LLeweLLyn Reese
0 siblings, 1 reply; 12+ messages in thread
From: James Buchanan @ 2002-12-27 4:25 UTC (permalink / raw)
To: LLeweLLyn Reese, Matt Juszczak; +Cc: gcc-help
GNU autoconf, automake and libtool by Vaughan, Elliston, Tromey and Taylor
published by New Riders. Excellent book and good tutorial and
reference. For make, try the GNU Make book published by the FSF
Press. There is "Using and Porting GCC" or something like that, also
published by the FSF Press. If you get that, also get the GNU C Library
book by the FSF Press. All excellent books, and all available free in
postscript format, too (the FSF ones.) I usually print these and stick
them in ringbinders since there is no way I can afford to buy all these books.
At 10:37 AM 12/26/2002 -0800, LLeweLLyn Reese wrote:
>"Matt Juszczak" <matt@atopia.net> writes:
>
> > Is there a good book that not only brushes up C/C++ skills but also focuses
> > on Makefiles, etc. (GNU-make, GNU-gcc, autoconf, etc.)
>[snip]
>
>$info make
>$info gcc
>$info autoconf
>
>:-)
>
>I don't know of a good book on any of make, gcc, or autoconf, except
> their respective info documentation. I wish I did. The gnu make
> info pages have an excellent tutorial, the autoconf pages a
> mediocre tutorial. The gcc info pages are a wonderful reference,
> but, I fear, quite confusing to those not already familiar with
> its convention.
>
>www.accu.org has excellent book reviews of many, many books, on many
> subjects (but mostly on C, C++, and Java.)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: c++ question
2002-12-27 4:25 ` James Buchanan
@ 2002-12-27 4:56 ` LLeweLLyn Reese
2002-12-29 5:43 ` Ben Elliston
0 siblings, 1 reply; 12+ messages in thread
From: LLeweLLyn Reese @ 2002-12-27 4:56 UTC (permalink / raw)
To: James Buchanan; +Cc: Matt Juszczak, gcc-help
James Buchanan <jamesbuch@iprimus.com.au> writes:
> GNU autoconf, automake and libtool by Vaughan, Elliston, Tromey and
> Taylor published by New Riders.
Thank you. I'll see if a local store has a copy I can pre-read before
buying.
> Excellent book and good tutorial and
> reference. For make, try the GNU Make book published by the FSF
> Press.
I've got an alder copy of that. As far as I can tell, it is a printed
version of 'info make'. (one of the goals of the texinfo doc
format is printed and electronic manuals from the same source.)
> There is "Using and Porting GCC" or something like that, also
> published by the FSF Press.
Again, that's a printed version of 'info gcc', and again, I've an
older copy somewheres. Of course now the gcc manual is being split
into user sections and porting sections, but I strongly suspect
the new printed gcc books will continue to be identical to the
online docs.
> If you get that, also get the GNU C
> Library book by the FSF Press.
This one I don't have, but I suspect it is also similar to 'info
glibc'.
It's good you mentioned them; they are easier on the eyes, cheap,
buying them supports the FSF, etc. And they are good books
(despite that I implied earlier that they weren't books) but they
are identical to the online version, as far as I know.
> All excellent books, and all available
> free in postscript format, too (the FSF ones.) I usually print these
> and stick them in ringbinders since there is no way I can afford to
> buy all these books.
It's been years since I bought one, but I thought they were ~US$10 a
copy or so (printed, that is)... (the softweare field is
interesting in this way; when one is employed, books are often
ridicoulously cheap in proportion to one's income. When one isn't
employed, they are quite expensive.)
[snip]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [SCALUG] Re: c++ question
2002-12-26 10:39 ` [SCALUG] " John Burski
@ 2002-12-27 8:06 ` Andrea 'fwyzard' Bocci
2002-12-27 9:56 ` John Burski
0 siblings, 1 reply; 12+ messages in thread
From: Andrea 'fwyzard' Bocci @ 2002-12-27 8:06 UTC (permalink / raw)
To: John Burski; +Cc: scalug-list, gcc-help
At 11.18 26/12/2002 +0600, John Burski wrote:
>My thanks to those who responded to my question -- I really appreciate the
>help.
>
>However, my problem still remains.
>
>
>// cut here - hello.cc
>
>#include <iostream>
>using namespace std;
>
>int main()
>{
> cout << "Hello, World\n";
>}
>// cut here -eof
// cut here - hello.cc
hello: hello.o
g++ hello.o -o hello
hello.o: hello.cc
g++ hello.cc -c -o hello.o
// cut here -eof
At the prompt:
$ make
g++ hello.cc -c -o hello.o
g++ hello.o -o hello
$ ./hello
Hello, World
So, it worke quite well for me.
I think explicitly adding libgcc on the command line (which incidentally is
a Bad Thing TM) screws up the librari dependancies.
Don't do it.
The same hold true for adding /usr/include/g++-3 to you include search
path. There's no need for it, it's done automatically and permanently by
the "make install" part of the GCC installation.
HTH,
fwyzard
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [SCALUG] Re: c++ question
2002-12-27 8:06 ` Andrea 'fwyzard' Bocci
@ 2002-12-27 9:56 ` John Burski
0 siblings, 0 replies; 12+ messages in thread
From: John Burski @ 2002-12-27 9:56 UTC (permalink / raw)
To: Andrea 'fwyzard' Bocci; +Cc: scalug-list, gcc-help
Hoopla!!
Thanks for your help! I can see that I've been away from my roots for
too long :(
Incidentally, just for kicks I changed the "using namespace std;" phrase
to "using std::cout;" and it worked well, too.
Thanks again!
Andrea 'fwyzard' Bocci wrote:
> At 11.18 26/12/2002 +0600, John Burski wrote:
>
>> My thanks to those who responded to my question -- I really
>> appreciate the help.
>>
>> However, my problem still remains.
>>
>>
>> // cut here - hello.cc
>>
>> #include <iostream>
>> using namespace std;
>>
>> int main()
>> {
>> cout << "Hello, World\n";
>> }
>> // cut here -eof
>
>
> // cut here - hello.cc
> hello: hello.o
> g++ hello.o -o hello
>
> hello.o: hello.cc
> g++ hello.cc -c -o hello.o
>
> // cut here -eof
>
> At the prompt:
> $ make
> g++ hello.cc -c -o hello.o
> g++ hello.o -o hello
>
> $ ./hello
> Hello, World
>
> So, it worke quite well for me.
> I think explicitly adding libgcc on the command line (which
> incidentally is a Bad Thing TM) screws up the librari dependancies.
> Don't do it.
> The same hold true for adding /usr/include/g++-3 to you include search
> path. There's no need for it, it's done automatically and permanently
> by the "make install" part of the GCC installation.
>
> HTH,
> fwyzard
>
> .
>
--
John Burski
@HOME S.I.M.U. (Well, sometimes I am :) )
... and still searching for the cheese!
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: c++ question
2002-12-27 4:56 ` LLeweLLyn Reese
@ 2002-12-29 5:43 ` Ben Elliston
2002-12-29 6:09 ` LLeweLLyn Reese
0 siblings, 1 reply; 12+ messages in thread
From: Ben Elliston @ 2002-12-29 5:43 UTC (permalink / raw)
To: gcc-help
>>>>> "LLeweLLyn" == LLeweLLyn Reese <llewelly@lifesupport.shutdown.com> writes:
>> GNU autoconf, automake and libtool by Vaughan, Elliston, Tromey and
>> Taylor published by New Riders.
LLeweLLyn> Thank you. I'll see if a local store has a copy I can
LLeweLLyn> pre-read before buying.
You can read it on sources.redhat.com/autobook/. It's published under
a free publication license.
Cheers, Ben
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: c++ question
2002-12-29 5:43 ` Ben Elliston
@ 2002-12-29 6:09 ` LLeweLLyn Reese
0 siblings, 0 replies; 12+ messages in thread
From: LLeweLLyn Reese @ 2002-12-29 6:09 UTC (permalink / raw)
To: Ben Elliston; +Cc: gcc-help
Ben Elliston <bje@redhat.com> writes:
> >>>>> "LLeweLLyn" == LLeweLLyn Reese <llewelly@lifesupport.shutdown.com> writes:
>
> >> GNU autoconf, automake and libtool by Vaughan, Elliston, Tromey and
> >> Taylor published by New Riders.
>
> LLeweLLyn> Thank you. I'll see if a local store has a copy I can
> LLeweLLyn> pre-read before buying.
>
> You can read it on sources.redhat.com/autobook/. It's published under
> a free publication license.
Thank you. So far I'm liking it. If all goes well I'll buy it.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2002-12-29 6:49 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-25 13:30 c++ question John Burski
2002-12-25 16:22 ` Alexander Helm
2002-12-26 2:26 ` LLeweLLyn Reese
2002-12-26 9:17 ` Matt Juszczak
2002-12-26 11:25 ` LLeweLLyn Reese
2002-12-27 4:25 ` James Buchanan
2002-12-27 4:56 ` LLeweLLyn Reese
2002-12-29 5:43 ` Ben Elliston
2002-12-29 6:09 ` LLeweLLyn Reese
2002-12-26 10:39 ` [SCALUG] " John Burski
2002-12-27 8:06 ` Andrea 'fwyzard' Bocci
2002-12-27 9:56 ` John Burski
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).