Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error - hello-reason example - macOS host, iOS simulator target #34

Open
dboris opened this issue Sep 10, 2021 · 4 comments
Open

Comments

@dboris
Copy link

dboris commented Sep 10, 2021

Trying to build the hello-reason example under macOS 11.5.2:

% esy generate ios.simulator.x86_64
...
    Undefined symbols for architecture x86_64:
      "_libiconv", referenced from:
          _g_iconv in libglib-2.0.a(libglib_2_0_la-gconvert.o)
          _g_convert_with_iconv in libglib-2.0.a(libglib_2_0_la-gconvert.o)
          _g_convert_with_fallback in libglib-2.0.a(libglib_2_0_la-gconvert.o)
      "_libiconv_close", referenced from:
          _g_iconv_close in libglib-2.0.a(libglib_2_0_la-gconvert.o)
          _g_convert in libglib-2.0.a(libglib_2_0_la-gconvert.o)
          _g_convert_with_fallback in libglib-2.0.a(libglib_2_0_la-gconvert.o)
          _g_filename_display_name in libglib-2.0.a(libglib_2_0_la-gconvert.o)
      "_libiconv_open", referenced from:
          _g_iconv_open in libglib-2.0.a(libglib_2_0_la-gconvert.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [pkg-config] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2
    error: command failed: 'make' (exited with 2)
    esy-build-package: exiting with errors above...
    
  building yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79
@EduardoRFS
Copy link
Owner

Can you give me your esy.json? So that I can reproduce, but my bet is that it's some package which doesn't work well on macOS 11.5

@dboris
Copy link
Author

dboris commented Sep 11, 2021

I cloned this repo, then cd examples/hello-reason, then followed the readme to build it. I don't see esy.json in that dir. Below is the package.json:

{
  "name": "hello-reason",
  "version": "0.0.0",
  "esy": { "build": "dune build @all" },
  "scripts": { "start": "#{self.target_dir}/default/bin/hello.exe" },
  "dependencies": {
    "@opam/reason": "^3.7.0",
    "@opam/dune": "*",
    "@reason-native/console": "^0.1.0",
    "@reason-native/pastel": "^0.3.0",
    "ocaml": "4.12.x"
  },
  "resolutions": {
    "@esy-ocaml/reason":
      "EduardoRFS/reason:reason.json#35aa4df3de0daa60bdc1133dcf97855decac48f7"
  },
  "devDependencies": {
    "generate":
      "github:EduardoRFS/reason-mobile:generate.json#7ba258319b87943d2eb0d8fb84562d0afeb2d41f"
  }
}

On the other hand, there is an esy.lock dir in there. Am I not doing something right?

@EduardoRFS
Copy link
Owner

@dboris you're probably following it right, not sure why the problem is happening, my guest is that Apple did something again and I need to fix this.

@dboris
Copy link
Author

dboris commented Oct 20, 2022

This SO comment gives a hint. How can I tell esy to link to libiconv from a specific directiory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants