Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7682505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:35:02+00:00 2026-05-31T18:35:02+00:00

Am getting this error for my code: Undefined symbols for architecture x86_64: _spendDollars, referenced

  • 0

Am getting this error for my code:

Undefined symbols for architecture x86_64:
  "_spendDollars", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Have checked the code, but can’t find the error. Here it is:

#import <Foundation/Foundation.h>

typedef struct {
    float exchangeRate;
    double budget;
    //double euroTransaction;
    double exchangeTransaction;
} budget;

//budget vacationBudget;
budget vacationBudgetEurope;
budget vacationBudgetEngland;

//void spendDollars (double dollars);

//void chargeEuros (double euros);

void spendDollars(budget* theBudget, double dollars);
void chargeForeignCurrency(budget* theBudget, double foreignCurrency);

int main(int argc, const char * argv[])
{

        //budget vacationBudget;

        //vacationBudget.exchangeRate = 1.2500;
    vacationBudgetEurope.budget = 1000;
        //vacationBudget.budget = 1000.00;
    vacationBudgetEurope.budget = 1000.00;
        //double numberDollars = 100;
    double numberDollarsInEuroland = 100;
    double numberEuros = 100;

    vacationBudgetEngland.exchangeRate = 1.5000;
    vacationBudgetEngland.budget = 2000.00;
    double numberDollarsInPoundland = 100;
    double numberPounds = 100;

        //vacationBudget.budget -= 100.00;

    //spendDollars(numberDollars);
    spendDollars(&vacationBudgetEurope, numberDollarsInEuroland);


    //NSLog(@"Converting %.2f US dollars into euros leaves $%.2f dollars", numberDollars, vacationBudget.budget); 
    NSLog(@"Converting %.2f US dollars into euros leaves $%.2f", numberDollarsInEuroland, vacationBudgetEurope.budget);
    //chargeEuros(numberEuros);
    chargeForeignCurrency(&vacationBudgetEurope, numberEuros);
    //NSLog(@"Charging %.2f euros leaves $%.2f", numberEuros, vacationBudget.budget);
    NSLog(@"Charging %.2f euros leaves $%.2f", numberEuros, vacationBudgetEurope.budget);
    spendDollars(&vacationBudgetEngland, numberDollarsInPoundland);
    NSLog(@"Converting %.2f US dollars into pounds leaves $%.2f", numberDollarsInPoundland, vacationBudgetEngland.budget);
    chargeForeignCurrency(&vacationBudgetEngland, numberPounds);
    NSLog(@"Charging %.2f pounds leaves $%.2f", numberPounds, vacationBudgetEngland.budget);


    return 0;
}

//void spendDollars (double dollars) {
//    vacationBudget.budget -= dollars;
//}

void chargeForeignCurrency (budget* theBudget, double foreignCurrency) {
    theBudget -> exchangeTransaction = foreignCurrency*theBudget -> exchangeRate;
    theBudget ->budget -= theBudget -> exchangeTransaction;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T18:35:03+00:00Added an answer on May 31, 2026 at 6:35 pm

    That error message is telling you exactly what the problem is. You don’t have a function called spendDollars() in your program. Well, you do, but it’s commented out. The commented out function doesn’t match the signature you’re using though, so it looks like you have some code to write.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I am getting this eror: Undefined symbols: _sqlite3_open, referenced from: _main in ccRlWVer.o
I'm getting this error when building in Xcode for iOS. Undefined symbols for architecture
I'm not sure why I'm getting this error, but shouldn't this code compile, since
Getting this error while compiling C++ code: undefined reference to `__stack_chk_fail' Options already tried:
I'm getting this worthless error in my code. it's very consistant and restarting the
I'm getting this error message with the code below: class Money { public: Money(float
I keep getting this error System.Web.HttpException was unhandled by user code Message=Validation of viewstate
I am getting this error when I try to build for the device: Code
I keep getting this error whenever I call gethostbyname() in my C code. ==7983==
I keep on getting this error error: expected specifier-qualifier-list for core data code im

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.