building for iOS-arm64 but attempting to link with file built for unknown-x86_64

1.1k views Asked by At

What I am trying to accomplish is to take code generated from f2c and use it in my existing Xcode project. I have all of the .C files in my project directory but I am unable to build the project. I asked a previous question but I think what I am now experiencing is a separate issue so I am asking a new question.

I know that there is a libf2c.a file that is also a part of using f2c and I suspect it was part of the issue with my original question I asked but I am unsure. I tried placing the libf2c.a file in my Xcode project and including it in Targets->Build phases->Link binary with libraries and added the path to Build Settings->Search Paths->Library search paths but I still was getting the same error as in my other question which was:

Undefined symbols for architecture arm64:
      "_s_wsle", referenced from:
          _xplannr_ in X1.o

          ...
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

Now after doing some more research I discovered that a .a file is just an archive and everything can be extracted with ar x libf2c.a and that is what I did. After running that command I got a bunch of .o files. I placed all of the .o files in my Xcode project and now the error I get for almost every .o file is:

ld: warning: ignoring file /Users/.../libf2c.a, building for iOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/.../wsne.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../getenv_.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../s_cmp.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../c_abs.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../h_mod.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../wsfe.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../sfe.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_abs.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../ctype.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_log.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../main.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_sin.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../hl_lt.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_lg10.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_sinh.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../err.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../i_dim.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../dolio.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_imag.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_sin.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_exp.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../f77vers.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../etime_.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../i_indx.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../lbitbits.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_sqrt.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../z_log.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_nint.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_cos.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../signal_.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../l_lt.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../ftell_.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../uio.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../i_len.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../cabs.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_sign.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../h_nint.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../sue.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../c_exp.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_dim.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../z_sqrt.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../util.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_cnjg.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_abs.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_cosh.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../s_stop.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../exit_.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../typesize.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../z_exp.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_tan.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_imag.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../rsfe.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../pow_ii.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../h_dim.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../c_sqrt.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../pow_ci.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../rsli.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../s_paus.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../c_sin.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../c_log.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64ld: warning: ignoring file /Users/.../getarg_.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../h_len.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file /Users/.../hl_gt.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../wsle.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../i_mod.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../fmtlib.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../ilnw.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_tan.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../c_cos.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../pow_zi.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../pow_di.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_mod.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../lwrite.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../ef1cmc_.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_acos.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_sign.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../open.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_atn2.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../derfc_.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../pow_dd.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../lread.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../h_abs.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_int.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_dim.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_asin.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../r_int.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../fmt.o, building for iOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/.../d_atan.o, building for iOS-arm64 but attempting ...

Undefined symbols for architecture arm64:
  "_s_wsle", referenced from:
      _plannr_ in X1.o
  ...

I see there is a wsle.o file so I would imagine _s_wsle would come from there as one example?

This answer seems to solve the problem in general but I think I need some help doing the same thing within Xcode.

Any ideas/suggestions are appreciated.

0

There are 0 answers