Thread: new error message for me

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595

    new error message for me

    I'm getting an error message I've not encountered before. The message is:

    ....player.cpp(14) : error C2059 : syntax error : 'PCH creation point'

    player.cpp is the cpp file for a class called Player. The error always occurs at the first line of the code after the #include "Player.h" line, even if I comment out the first line by placing the original first line in the header file instead of the cpp file. The error goes away when I strip the class down to an empty default constructor and empty default destructor and I'm building the file back piece by piece to see what seems to trigger the error, and I'll hopefully be able to fix it that way, but knowing where to look and understanding the error might decrease the debugging time. Anybody know what that error means?

    VC 6.0
    Windows 98

    Thanks.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Remove the "Use precompiled header" option from your project options. It's got to do something with that.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    Thanks for the idea. I'll look into that and post what I come up with later. Any other ideas welcome.

  4. #4
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    For the love of pete! The error wasn't even in the player.cpp file. It was in the player.h file. I had a ) instead of } at the end of a one line method body. How or what that has to do with a PCH creation point, or even what the heck a/the PCH creation is, is something I don't understand. But correcting the syntax resolved the error message. So much for helpful error messages!

    I take that back. I have to admit the error messages are usually pretty helpful. And, it's a lot better with 'em than without 'em!!!

  5. #5
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    PCH means Pre-Compiled-Header. Turn that feature off in the project settings, I have yet to encounter a project where it would have been useful for something else then annoying and superfluent error messages.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    nvoigt: large project. Very large projects. It can immensely speed up compilation there.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  7. #7
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    I do have projects that compile for 10 Minutes or more, but still, the compilation speed gain does not outweight the constant harrassment of PCH error messages from my point of view especially when you have to include other peoples code and don't have control over 100% of the source.

    After all you don't have to compile it more than once per hour and taking a break isn't that bad anyway
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  8. #8
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    I thought pre-compiled headers referred to standard header files, and things like stdafx.h. It didn't dawn on me until just now that any header compiled before the current file could be considered pre-compiled and that the compiler could keep track of those files that didn't change between last compiling and current run to increase speed of compiling. Duh.

  9. #9
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    nvoigt, I'm referring to projects like Mozilla, which compile for an hour or more.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed