Problem...

This is a discussion on Problem... within the C++ Programming forums, part of the General Programming Boards category; I'm trying to compile this program and it gives me the following errors: mp.obj : error LNK2001: unresolved external symbol ...

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    31

    Problem...

    I'm trying to compile this program and it gives me the following errors:


    mp.obj : error LNK2001: unresolved external symbol "public: void __thiscall Fraction::reduce(int,int)" (?reduce@Fraction@@QAEXHH@Z)

    imp.obj : error LNK2001: unresolved external symbol "public: struct fraction __thiscall Fraction:ivide(struct fraction,struct fraction)" (?Divide@Fraction@@QAE?AUfraction@@U2@0@Z)

    imp.obj : error LNK2001: unresolved external symbol "public: struct fraction __thiscall Fraction::Multiply(struct fraction,struct fraction)" (?Multiply@Fraction@@QAE?AUfraction@@U2@0@Z)

    imp.obj : error LNK2001: unresolved external symbol "public: struct fraction __thiscall Fraction::Subtract(struct fraction,struct fraction)" (?Subtract@Fraction@@QAE?AUfraction@@U2@0@Z)

    imp.obj : error LNK2001: unresolved external symbol "public: struct fraction __thiscall Fraction::Add(struct fraction,struct fraction)" (?Add@Fraction@@QAE?AUfraction@@U2@0@Z)
    Debug/Fraction.exe : fatal error LNK1120: 5 unresolved externals
    Error executing link.exe.

    Can someone tell me what they mean?

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    That means that it can't find the actual code for those functions.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    162
    post some code ...

  4. #4
    Registered User
    Join Date
    Apr 2003
    Posts
    31
    Last edited by Aakash Datt; 04-28-2003 at 08:05 PM.

  5. #5
    Registered User
    Join Date
    Feb 2003
    Posts
    162
    Code:
    Fraction:: Add (fraction a, fraction b)
    thats your first problem....you have the function Add of class Fraction, but you forgot what it returns....it returns a type fraction (your structure), so throw that in there ..... fraction Fraction :: Add (....)

    2nd,

    Code:
    fraction Multiply (fraction a, fraction b)
    you have that....now you have what it returns, but forgot it was part of the class Fraction ....fraction Fraction :: Multiply (....)

    you did both of those more than once, so fix those 2 problems, and you should be all set.

  6. #6
    Aakash
    Guest

    ....

    Not quite...I'm not getting even more errors...72....

  7. #7
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640

    Re: ....

    Originally posted by Aakash
    Not quite...I'm not getting even more errors...72....
    care to share the errors/revised code or should i read your mind....

  8. #8
    Registered User
    Join Date
    Feb 2003
    Posts
    162
    well I hope your not running it with IMPLEMENTATION: and CLIENT: in there....post your updated code ...

  9. #9
    Registered User
    Join Date
    Apr 2003
    Posts
    31

    Lightbulb nevermind

    It's working properly now.

    Thanks go to XSquared, Jamsan, and Perspective.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 10:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21