Thread: K&R example help - program error

  1. #1
    Registered User
    Join Date
    Feb 2008
    Location
    Yokohama
    Posts
    48

    K&R example help - program error

    Hi,
    I just typed in the example from K&R page 76 and I am guessing I made a typo even though I cannot find it. When I try to compile the program I get some errors and I am hoping that someone here will figure out what I did wrong from those errors.

    p76.obj : error LNK2019: unresolved external symbol _pop referenced in function _main
    p76.obj : error LNK2019: unresolved external symbol _push referenced in function _main
    p76.obj : error LNK2019: unresolved external symbol _getop referenced in function _main

    What do you think?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    What is the example? It sounds like you forgot to implement some functions, e.g., they were given in another example, but used in this example.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Feb 2008
    Location
    Yokohama
    Posts
    48
    Thanks. You are right. That is exactly what I did.
    Sorry, I am a beginner and I thought the functions were simply declarations of variables. Thanks for your help and good catch.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 04:35 PM
  3. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM

Tags for this Thread