can't understand the compiler messages

  • Thread starter forgotten field
  • Start date
F

forgotten field

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.
 
J

John Harrison

forgotten field said:
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
 
J

John Harrison

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
 
P

Peter Nolan

http://www.amazon.com/exec/obidos/t...f=sr_1_6/102-4187339-5794511?v=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
 
K

Kevin Goodsell

Peter said:
http://www.amazon.com/exec/obidos/t...f=sr_1_6/102-4187339-5794511?v=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/rvout.cgi?from=0au_j&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
 
J

jeffc

forgotten field said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top