[SCALUG] Re: c++ question
John Burski
jburski@cloudnet.com
Thu Dec 26 10:39:00 GMT 2002
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!
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hello0.cpp
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hello1.cpp
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile1
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile2
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0003.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile3
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0004.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile4
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0005.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile5
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0006.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile6
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0007.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: make1.txt
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: make2.txt
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: make3.txt
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: make4.txt
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0003.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: make5.txt
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0004.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: make6.txt
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0005.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hello2.cpp
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0008.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile7
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0009.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: make7.txt
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021226/fad8953f/attachment-0006.txt>
More information about the Gcc-help
mailing list