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

Fix broken dynamic library compile on osx #1

Merged
merged 1 commit into from
Apr 14, 2017

Conversation

stroxler
Copy link
Contributor

It was remarkably hard tracking down the problem.
I found the solution here:
openai/universe#167

Without this fix, I was getting an error that looked like this:

> python python_to_go.py
Traceback (most recent call last):
  File "python_to_go.py", line 12, in <module>
    lib = cdll.LoadLibrary('go_adder/libadder.' + lib_extension())
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 440, in LoadLibrary
    return self._dlltype(name)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 362, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(go_adder/libadder.dylib, 6): no suitable image found.  Did find:
	go_adder/libadder.dylib: malformed mach-o image: segment __DWARF vm overlaps segment __LINKEDIT
	/Users/steventroxler/kode/scratch/go-interlang/dyn_langs_to_go/go_adder/libadder.dylib: malformed mach-o image: segment __DWARF vm overlaps segment __LINKEDIT

It was remarkably hard tracking down the problem.
I found the solution here:
openai/universe#167

Without this fix, I was getting an error that looked like this:
```
> python python_to_go.py
Traceback (most recent call last):
  File "python_to_go.py", line 12, in <module>
    lib = cdll.LoadLibrary('go_adder/libadder.' + lib_extension())
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 440, in LoadLibrary
    return self._dlltype(name)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 362, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(go_adder/libadder.dylib, 6): no suitable image found.  Did find:
	go_adder/libadder.dylib: malformed mach-o image: segment __DWARF vm overlaps segment __LINKEDIT
	/Users/steventroxler/kode/scratch/go-interlang/dyn_langs_to_go/go_adder/libadder.dylib: malformed mach-o image: segment __DWARF vm overlaps segment __LINKEDIT
```
Copy link
Owner

@draffensperger draffensperger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix!

@draffensperger draffensperger merged commit 8f58eba into draffensperger:master Apr 14, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants