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

Mac OS: Undefined symbols for architecture x86_64 #111

Closed
liepauls opened this issue Mar 11, 2019 · 3 comments
Closed

Mac OS: Undefined symbols for architecture x86_64 #111

liepauls opened this issue Mar 11, 2019 · 3 comments

Comments

@liepauls
Copy link

Hey, thanks for the awesome gem!

I managed to install the gem on ubuntu with no issues, however on mac OS (mojave) I'm getting errors while compiling:

$ gem install rice -v '2.1.3'
Building native extensions. This could take a while...
ERROR:  Error installing rice:
  ERROR: Failed to build gem native extension.

...

ld: warning: ignoring file ../rice/librice.a, file was built for archive which is not the architecture being linked (x86_64): ../rice/librice.a
Undefined symbols for architecture x86_64:

...

  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
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]: *** [unittest] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.5.1/gems/rice-2.1.3 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-2.5.1/extensions/x86_64-darwin-17/2.5.0/rice-2.1.3/gem_make.out

Full output here - https://pastebin.com/raw/u3UDkbnj

Let me know if any additional info is required and thanks for your time.

@jasonroelofs
Copy link
Collaborator

I'm not sure what's going on here. I am also on Mojave and haven't seen this error before. The file librice.a is built as part of the gem install process so it seems that something related to your build environment is acting differently than mine.

The only difference I can find in your output vs mine is:

ar: `u' modifier ignored since `D' is the default (see `U')

Which implies that you have a newer / different version of ar?

@liepauls
Copy link
Author

Alright, first I got rid of that warning, but the problem was still there.
After some googling I stumbled on tpoechtrager/osxcross#11 (comment)

I guess I had installed binutils (which includes AR) at some point, I uninstalled it and the gem installed successfully. Thanks!

@jasonroelofs
Copy link
Collaborator

Cool, glad you were able to figure it out!

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