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 7442117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:07:38+00:00 2026-05-29T11:07:38+00:00

I am trying to compile my source code into a library but i get

  • 0

I am trying to compile my source code into a library but i get this error

findingjimoh$ ar rcs libHeatingUnit.a HeatingUnit.o
/usr/bin/ranlib: warning for library: libHeatingUnit.a the table of contents is empty (no object file members in the library define global symbols)

The .a file is made but then i try to link it with an executable file and i get this error

findingjimoh$ g++ -o TemperatureControl BangBangControl.cpp -L. libBangBangControl.a libHeatingUnit.a 
ld: warning: ignoring file libHeatingUnit.a, file was built for archive which is not the architecture being linked (x86_64)

Here is my source

 // Jimoh Ovbiagele (JAO945)

 #include <stdio.h>
 #include <stdbool.h>

 class HeatingUnit {
   private:
bool isOn;
int temp;

   public:
/* Sets the unit's status and initial temp */
HeatingUnit(bool isOn, int temp){
  this -> isOn = isOn;
  this -> temp = temp;
}

HeatingUnit(){

}

/* Turns unit on */
void turnOn(){
  isOn = true;
}

/* Turns unit off */
void turnOff(){
  isOn = false;
}

int tick(){
  if(isOn) temp++;
  else temp--;      
  return temp;
}
};
  • 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-29T11:07:39+00:00Added an answer on May 29, 2026 at 11:07 am

    file was built for archive which is not the architecture being linked (x86_64)

    You should use the same toolchain you used to compile the object file to create the library, for example, if you used arm-none-eabi-gcc to compile use arm-none-eabi-ar to archive.

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

Sidebar

Related Questions

Trying to compile non-PIC code into a shared library on x64 with gcc results
I'm trying to compile code from an open source project, and I'm running into
I'm trying to detect the compiler used to compile my source code. I can
I was recently fighting some problems trying to compile an open source library on
recently I downloaded this open source project and I am trying to compile it.
Trying to compile a iPhone/iPad application with SDK3.2 and am getting this error: Undefined
When trying to compile my class I get an error: The constant 'NamespaceName.ClassName.CONST_NAME' cannot
I'm trying to embed binary media resources into source code. I will going to
I downloaded the Android PDF Viewer source code and am trying to compile it
I'm running into a problem while trying to compile my code: D:\workspace>javac DbConnect.class javac:

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.