0

I'm a Mac user I'm trying to create a netcdf using gfortran, but I get the following error My Mac is using an M1 chip

    Undefined symbols for architecture arm64:
  "___netcdf_MOD_nf90_close", referenced from:
      _MAIN__ in ccHtjGFn.o
  "___netcdf_MOD_nf90_create", referenced from:
      _MAIN__ in ccHtjGFn.o
  "___netcdf_MOD_nf90_def_dim", referenced from:
      _MAIN__ in ccHtjGFn.o
  "___netcdf_MOD_nf90_def_var_manydims", referenced from:
      _MAIN__ in ccHtjGFn.o
  "___netcdf_MOD_nf90_put_att_one_fourbyteint", referenced from:
      _MAIN__ in ccHtjGFn.o
  "___netcdf_MOD_nf90_put_att_one_fourbytereal", referenced from:
      _MAIN__ in ccHtjGFn.o
  "___netcdf_MOD_nf90_put_att_text", referenced from:
      _MAIN__ in ccHtjGFn.o
  "___netcdf_MOD_nf90_put_var_1d_fourbytereal", referenced from:
      _MAIN__ in ccHtjGFn.o
  "___netcdf_MOD_nf90_put_var_2d_fourbytereal", referenced from:
      _MAIN__ in ccHtjGFn.o
  "___netcdf_MOD_nf90_strerror", referenced from:
      _check.0 in ccHtjGFn.o
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status

I don't know how to solve errors that I haven't seen on Windows

이수현
  • 11
  • 2
  • See https://stackoverflow.com/questions/66855252/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix and [mcve]. You have to show us what you are doing. You always must show which exact command produxed the error messages you show and the complete output. See also [ask]. It is necessary to provide more details, especially how you are linking the code together and with libraries like NetCDF. – Vladimir F Героям слава Sep 03 '23 at 04:59
  • I have actually.no idea what should "Open netcdf with gfortran" or "trying to create a netcdf". Are you trying to compile the library or use the library in your code? Really, we need the exact commands. – Vladimir F Героям слава Sep 03 '23 at 06:01

0 Answers0