Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   can't understand the compiler messages (http://www.velocityreviews.com/forums/t282049-cant-understand-the-compiler-messages.html)

forgotten field 04-04-2004 07:12 AM

can't understand the compiler messages
 
Hi,how are you?
I have been studying C++ by myself, but recently I am having a real
problem. I am learning about the basic usage of a doubly linked list
using polymorphism. However, I have got the compiler errors which I
just can't understand what they mean. I searched the webs for any
clues on how to solve the problems. But I've never been able to find
one.
Now I am wondering if there is any website which tells people how to
understand what those compiler errors mean, and some general tips on
how to solve those compiler errors. If I can at least get to run this
program, I can use a debugger, but at this point, I can't even use a
debugger.
I am beginning to realize the difficulty of learning C++ all by
myself, so I am thinking about taking some online C++ lessons where I
can interactively ask questions on C++ with somebody who is
experienced in C++. Could anybody give me any suggestions?
I did not put the actual source code that I wrote because that is
rather a long code, and I did not know if putting such a thing would
be suitable in this newsgroup. However if anybody would consider
taking a look at my code, and give me any suggestion, I would gladly
put the actual code that is giving me a headache.
Thank you very much, and have a good day.

John Harrison 04-04-2004 08:00 AM

Re: can't understand the compiler messages
 

"forgotten field" <tttakashi@yahoo.com> wrote in message
news:874b0024.0404032312.336fd7c7@posting.google.c om...
> Hi,how are you?
> I have been studying C++ by myself, but recently I am having a real
> problem. I am learning about the basic usage of a doubly linked list
> using polymorphism.


That's a slightly strange combination. Are you using polymorphism to
implement a linked link? I don't think that's a good idea.

> However, I have got the compiler errors which I
> just can't understand what they mean. I searched the webs for any
> clues on how to solve the problems. But I've never been able to find
> one.
> Now I am wondering if there is any website which tells people how to
> understand what those compiler errors mean, and some general tips on
> how to solve those compiler errors. If I can at least get to run this
> program, I can use a debugger, but at this point, I can't even use a
> debugger.


This place is the best I know for solving compiler problems, post compilable
code that generates the error and this group will solve it pretty quick.

Every compiler is different, abd everyones coding style is different
(including the typical mistakes they make). This means that two programmers
can work with the same compiler and still see completely different error
messages. It's really a matter of not taking the compiler error messages
literally, not paying any attention to the messages after to first two or
three, and gradually learning to interpret what the error messages mean for
you.

> I am beginning to realize the difficulty of learning C++ all by
> myself,


Absolutely. A good book helps though.

> so I am thinking about taking some online C++ lessons where I
> can interactively ask questions on C++ with somebody who is
> experienced in C++. Could anybody give me any suggestions?


I don't know of any interactive place. But if you're prepared to slow down a
bit this place is as good as it gets.

> I did not put the actual source code that I wrote because that is
> rather a long code, and I did not know if putting such a thing would
> be suitable in this newsgroup.


Long source code is not a good idea, although some people will be prepared
to read it. The best approach is to cut down the code until it is as small
as possible but still compilable and still contains the piece you don't
understand. I doesn't matter much that the code will no longer make any
sense. You may even learn something by going though this process.

> However if anybody would consider
> taking a look at my code, and give me any suggestion, I would gladly
> put the actual code that is giving me a headache.
> Thank you very much, and have a good day.


No problem. Very few people take the trouble to find out about this group
before posting for the first time.

john



John Harrison 04-04-2004 08:05 AM

Re: can't understand the compiler messages
 
> The best approach is to cut down the code until it is as small
> as possible but still compilable and still contains the piece you don't
> understand.


Since you are having trouble actually compiling I should say

The best approach is to cut down the code until it is as small
as possible but still produces the error message you don't
understand.

john



Peter Nolan 04-04-2004 02:04 PM

Re: can't understand the compiler messages
 
> "forgotten field" <tttakashi@yahoo.com> wrote in message

http://www.amazon.com/exec/obidos/tg...glance&s=books

Forgotten Field,
When I learned C++ I struggled for quite a while, went through quite a
few books until I came to Kris Jamsas Programmers Bible......I'm sure
there are plenty of others out there but I really like this one...you
get tons and tons of code with it, and it makes an excellent
transition from C (which I knew well) to C++. It also has a section on
C# to put it into context with everything else.....I'd highly
recommend you spend the money and at least get this book......

I too was not in a position where I could go to classes or learn from
a library of existing code at work so I had to learn from a book and
from the various sites on the web.

Also, check out sourceforge.net and codeproject.com.....there are
folks there who have posted source code for many applications both big
and small. If you have the patience to read the code you will learn
more about how to write C++.

Today it is more a case of sifting through large amounts of code to
try and find the few lines you are looking for, or asking the kind
folks here to assist.. :-)


Best Regards
Peter Nolan

Kevin Goodsell 04-04-2004 07:05 PM

Re: can't understand the compiler messages
 
Peter Nolan wrote:

>>"forgotten field" <tttakashi@yahoo.com> wrote in message

>
>
> http://www.amazon.com/exec/obidos/tg...glance&s=books
>
> Forgotten Field,
> When I learned C++ I struggled for quite a while, went through quite a
> few books until I came to Kris Jamsas Programmers Bible......I'm sure
> there are plenty of others out there but I really like this one...you
> get tons and tons of code with it, and it makes an excellent
> transition from C (which I knew well) to C++. It also has a section on
> C# to put it into context with everything else.....I'd highly
> recommend you spend the money and at least get this book......


Books combining C and C++ are a red flag for me. They usually don't
cover either very well. I checked the ACCU book reviews, and found that
this book's predecessor got a "Not Recommended" rating.

http://www.accu.org/cgi-bin/accu/rvo...&file=j001569a

Also, none of Jamsa's books that have been reviewed there have good ratings.

The ACCU book reviews carry a lot more weight than most reviews, because
they are done by people who know the subject matter, whereas most
reviews of "beginner" texts are reviewed by, well, beginners. Therefore
a book that explains things in a very clear way, with great examples,
will get good reviews on Amazon (for example) even if it's riddled with
factually incorrect information, errors, and bad advice. This doesn't
happen with the ACCU reviews.

For book recommendations, I would look at the alt.comp.lang.learn.c-c++ FAQ.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

jeffc 04-06-2004 02:59 PM

Re: can't understand the compiler messages
 

"forgotten field" <tttakashi@yahoo.com> wrote in message
news:874b0024.0404032312.336fd7c7@posting.google.c om...
> Hi,how are you?
> I have been studying C++ by myself, but recently I am having a real
> problem. I am learning about the basic usage of a doubly linked list
> using polymorphism. However, I have got the compiler errors which I
> just can't understand what they mean. I searched the webs for any
> clues on how to solve the problems. But I've never been able to find
> one.
> Now I am wondering if there is any website which tells people how to
> understand what those compiler errors mean, and some general tips on
> how to solve those compiler errors. If I can at least get to run this
> program, I can use a debugger, but at this point, I can't even use a
> debugger.


forgotten, that's a very good question IMO. Of course, each compiler is
different, so you have to study the documentation for your specific compiler
for help with the error messages. You should have it, or be able to
download it for free. That should help - a little. In general though,
there are certain problems that always seem to give obscure or confusing
error messages, and a list of common mistakes would probably be a help.
Unfortunately I'm not aware of any.

The most important thing I can suggest to you is to make small, incremental
changes. You start with

int main()
{
return 0;
}

Try to get that to compile, and then go from there. Don't make many changes
at once - just one at a time. If you make several, then go back to the last
working version and make one change and check the error. At that point, you
probably ought to be able to narrow down the problem with a very small
program that you can create and post here. Finally, don't confuse linker
messages with compiler messages! You might be having troubles with code
split across source files.





All times are GMT. The time now is 07:43 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.