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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:06:44+00:00 2026-06-02T19:06:44+00:00

Ok, what we have: Program written on C which compiling and running without problems

  • 0

Ok, what we have:

Program written on C which compiling and running without problems in Linux and MacOSX (leopard).
I embedded lua code today. Linux: compiled lua 5.1 from source. Everything works and compiles without any problems. Macos: compiled the same lua 5.1 package.

Linked with –llua.

Started compile and got an error:

CC=gcc-4.0 make

ld: warning: in /usr/local/lib/liblua.a, file is not of required architecture

Also tried reinstall, complete remove and installing from macports. The same.

So is there any fix for that?

  • 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-06-02T19:06:45+00:00Added an answer on June 2, 2026 at 7:06 pm

    The error "file is not of required architecture" hints to the fact that you’re trying to mix architectures.

    Check the architecture of the /usr/local/lib/liblua.a and make sure it matches the architecture or the object you’re trying to build.

    E.g.

    We have a i386 object:

    ==== cat fun.c ==== 
    #include <stdio.h>
    void fun()
    {
        printf("%s", "foobar\n");
    }
    gcc -arch i386 -c fun.c -o fun.o
    

    if we try to use it when compiling a x86_64 object (default architecture in Mac OS X):

    ===== cat test.c ==
    extern void fun();
    int main()
    {
        fun();
    }
    

    we get:

    $ gcc test.c fun.o
    ld: warning: ignoring file fun.o, file was built for i386 which is not the architecture being linked (x86_64)
    Undefined symbols for architecture x86_64:
      "_fun", referenced from:
          _main in ccXVCQhG.o
    ld: symbol(s) not found for architecture x86_64
    collect2: ld returned 1 exit status
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program written in C and running on Linux which acquires streaming
I have a program written in VB 2010 express under windows xp which does
I have written this program, which sorts some ints using a functor: #include<iostream> #include<list>
I have a program which i have myself written in java, but I want
I am beginning to port a program which is written in C and have
I have a debugging program which I've written to attach to a process and
I have a program written in C++, on Linux, compiled with -g. When I
I have a main program written in C# which creates and uses objects written
I have a program written in C, which is named computeWeight.c and to compile
I have a program written in VB.NET which stops a service that uses file

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.