can't understand the compiler messages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • forgotten field

    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

    #2
    Re: can't understand the compiler messages

    > The best approach is to cut down the code until it is as small[color=blue]
    > as possible but still compilable and still contains the piece you don't
    > understand.[/color]

    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


    Comment

    • John Harrison

      #3
      Re: can't understand the compiler messages


      "forgotten field" <tttakashi@yaho o.com> wrote in message
      news:874b0024.0 404032312.336fd 7c7@posting.goo gle.com...[color=blue]
      > 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.[/color]

      That's a slightly strange combination. Are you using polymorphism to
      implement a linked link? I don't think that's a good idea.
      [color=blue]
      > 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.[/color]

      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.
      [color=blue]
      > I am beginning to realize the difficulty of learning C++ all by
      > myself,[/color]

      Absolutely. A good book helps though.
      [color=blue]
      > 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?[/color]

      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.
      [color=blue]
      > 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.[/color]

      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.
      [color=blue]
      > 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.[/color]

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

      john


      Comment

      • John Harrison

        #4
        Re: can't understand the compiler messages

        > The best approach is to cut down the code until it is as small[color=blue]
        > as possible but still compilable and still contains the piece you don't
        > understand.[/color]

        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


        Comment

        • Peter Nolan

          #5
          Re: can't understand the compiler messages

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



          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

          Comment

          • Peter Nolan

            #6
            Re: can't understand the compiler messages

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



            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

            Comment

            • Kevin Goodsell

              #7
              Re: can't understand the compiler messages

              Peter Nolan wrote:
              [color=blue][color=green]
              >>"forgotten field" <tttakashi@yaho o.com> wrote in message[/color]
              >
              >
              > 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......[/color]

              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.



              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.l earn.c-c++ FAQ.

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

              Comment

              • Kevin Goodsell

                #8
                Re: can't understand the compiler messages

                Peter Nolan wrote:
                [color=blue][color=green]
                >>"forgotten field" <tttakashi@yaho o.com> wrote in message[/color]
                >
                >
                > 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......[/color]

                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.



                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.l earn.c-c++ FAQ.

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

                Comment

                • jeffc

                  #9
                  Re: can't understand the compiler messages


                  "forgotten field" <tttakashi@yaho o.com> wrote in message
                  news:874b0024.0 404032312.336fd 7c7@posting.goo gle.com...[color=blue]
                  > 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.[/color]

                  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.



                  Comment

                  • jeffc

                    #10
                    Re: can't understand the compiler messages


                    "forgotten field" <tttakashi@yaho o.com> wrote in message
                    news:874b0024.0 404032312.336fd 7c7@posting.goo gle.com...[color=blue]
                    > 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.[/color]

                    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.



                    Comment

                    Working...