Cant Figure Out This Darn Linker

This is a discussion on Cant Figure Out This Darn Linker within the C++ Programming forums, part of the General Programming Boards category; g++: -lobjc: linker input file unused since linking not done Well, the message is above, all I did was declare ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    49

    Exclamation Cant Figure Out This Darn Linker

    g++: -lobjc: linker input file unused since linking not done

    Well, the message is above,

    all I did was declare a few variables and some output and input, but I can't run the program and have it show any of it,
    DJGPP-Complier
    Windows 98-(Shouldn't need to explain)

    I like plants.

  2. #2
    Rad gcn_zelda's Avatar
    Join Date
    Mar 2003
    Posts
    942
    show us the program

  3. #3
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    What options were you using with g++?
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    49

    Here is the Program

    Code:
    #include <iostream.h>
    #include <stdlib.h>
    #include <DineOut.h>
    
    int main()
    {
     int DineOut;
     int YearBorn;
     int FinalNumber;
     int HaveYouHadBirth;
    
     cout<<"DINING OUT MATHEMATICS./n/n";
     system("PAUSE");
     cout<<"/n";
     cout<<"/t"<<"Here is some really neat math!/n";
     cout<<"/a/v";
     cout<<"First, enter the number of times that /n";
     cout<<"you would like to dine out a week./n";
     cout<<"(This number must be >1 but <10.)";
     cout<<"/n/n/t";
     cin>>DineOut;
     cout<<"/n/n";
     cout<<"Now, we will multiply this number by 2./n";
     cout<<"(Just to be bold!)";
     cout<<"/n/n/t";
     cout<<DineOut<<" x 2 = "<<Twice(DineOut)<<"/n/n";
     system("PAUSE");
     cout<<"/n/n";
     cout<<"Now, we will add 5 for Sunday.";
     cout<<"/n/n/t";
     cout<<DineOut<<" + 2 = "<<AddFive(DineOut)<<"/n/n";
     system("PAUSE");
     cout<<"/n/n";
     cout<<"Now Multiply it by 50.";
     cout<<"/n/n/t";
     cout<<DineOut<<" x 50 = "<<FiftyTimes(DineOut)<<"/n/n";
     system("PAUSE");
     cout<<"/n/n";
     cout<<"Now, if you've had your birthday, please press 1. ";
     cout<<"/n"<<"If you haven't, please press two.";
     cout<<"/n/t";
     cin>>HaveYouHadBirth;
     if (HaveYouHadBirth==1)
     {
     cout<<"/n/n";
     cout<<"Since you've had your birthday, we'll add 1753.";
     cout<<"/n/n/t"<<DineOut<<" + 1753 = "<<HadBirth(DineOut);
     cout<<"/n/n";
     system("PAUSE");
     }
     else if (HaveYouHadBirth==2)
     {
     cout<<"/n/n";
     cout<<"Since you haven't had your birthday, we'll add 1752.";
     cout<<"/n/n/t"<<DineOut<<" + 1752 = "<<NotHadBirth(DineOut);
    
     cout<<"/n/n";
     system("PAUSE");
     }
     else
     {
     cout<<"You have not entered a valid number./a/n/a/n";
     system("PAUSE");
     cout<<"This program will therefore not work correctly.";
     }
     cout<<"/n/n";
     cout<<"Now, enter the year you were born.";
     cout<<"/n/n/t";
     cin>>YearBorn;
     cout<<"/n/n";
     cout<<"Now, we will subtract the year you were born.";
     FinalNumber=DineOut - YearBorn;
     cout<<"/n/n/t"<<DineOut<<"  "<<YearBorn<<"= "
    <<FinalNumber;
    
     cout<<"/n/n";
     system("PAUSE");
     cout<<"/n/n";
     cout<<"Finally, you should be left with a three digit number.";
     cout<<"/n/t"<<FinalNumber;
     cout<<"The first digit is the number of times you would like to/n";
     cout<<"dine out a week./n";
     cout<<"The last two numbers are:/n"<<"duh duh duh duuuuuuuuuhhhhhhh!!!/n";
     cout<<"YOUR AGE!!! HAHAHA!!!";
     system("PAUSE");
     return 0;
    }

    Please use [code][/code]Tags
    DJGPP-Complier
    Windows 98-(Shouldn't need to explain)

    I like plants.

  5. #5
    Registered User
    Join Date
    Sep 2002
    Posts
    49

    Here is DineOut.h

    Code:
    class DineOut
    {
     public:
     double FiftyTimes(double x);
     double Twice(double x);
     double AddFive(double x);
     double HadBirth(double x);
     double NotHadBirth(double x);
    
     protected:
     double x;
    };
    
    double FiftyTimes(double x)
    {
     return x*50;
    }
    
    double Twice(double x)
    {
     return x*2;
    }
    
    double AddFive(double x)
    {
     return x+5;
    }
    
    double HadBirth(double x)
    {
     return x+1753;
    }
    
    double NotHadBirth(double x)
    {
     return x+1752;
    }
    Please use [code][/code]Tags
    Please use [code][/code]Tags
    DJGPP-Complier
    Windows 98-(Shouldn't need to explain)

    I like plants.

  6. #6
    Registered User
    Join Date
    Sep 2002
    Posts
    49

    I don't know about g++

    I don't know about g++, I'm using Dev C++ and my book doesn't talk about g++. I think it might be my complier, because when I run the executable, all that shows up is the system("PAUSE").
    DJGPP-Complier
    Windows 98-(Shouldn't need to explain)

    I like plants.

  7. #7
    Registered User
    Join Date
    Sep 2002
    Posts
    49
    SEEMS YOU'RE RIGHT, that could be why it's not working...O_o
    DJGPP-Complier
    Windows 98-(Shouldn't need to explain)

    I like plants.

  8. #8
    Registered User
    Join Date
    Sep 2002
    Posts
    49
    I changed all of them, but it's still not working.
    I DON"T GET IT :S
    DJGPP-Complier
    Windows 98-(Shouldn't need to explain)

    I like plants.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linker problem... no idea
    By cyreon in forum C Programming
    Replies: 2
    Last Post: 04-03-2009, 02:53 PM
  2. linker
    By George2 in forum C++ Programming
    Replies: 6
    Last Post: 02-23-2008, 12:25 AM
  3. Linker errors in VC++ 2005
    By C+/- in forum C++ Programming
    Replies: 0
    Last Post: 05-18-2007, 07:42 AM
  4. Linker error using system(*.*)
    By Winston4u in forum C Programming
    Replies: 5
    Last Post: 05-09-2003, 05:54 PM
  5. Compile with *.lib
    By Kelvin in forum C++ Programming
    Replies: 1
    Last Post: 07-23-2002, 06:24 PM

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