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

Undefined symbols for architecture x86_64 #1

Open
White2001Offl opened this issue Mar 23, 2022 · 11 comments
Open

Undefined symbols for architecture x86_64 #1

White2001Offl opened this issue Mar 23, 2022 · 11 comments

Comments

@White2001Offl
Copy link

White2001Offl commented Mar 23, 2022

Hi,
I tried every step to run the example file, But I get this error

Undefined symbols for architecture x86_64:
  "_helheimVersion", referenced from:
      __cgo_3b7158d1755a_Cfunc_helheimVersion in _x002.o
     (maybe you meant: __cgo_3b7158d1755a_Cfunc_helheimVersion)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm using MacOS M1 Pro. Not sure about Architecture

Installed this helheim-0.8.6-py310-darwin.x86_64

@bogdanfinn
Copy link
Owner

@White2001Offl please try to use the latest master branch of this repository.
_helheimVersion is something custom i added in my build helheim cffi library which got into master by accident.

i removed it yesterday evening so the master branch should be compatible.

regarding the M1 MacBook i can't say anything because i'm using a MacBook with Intel CPU.

Try to use the latest master branch version of this repo first, than this specific error should be gone.

@White2001Offl
Copy link
Author

Failed to initialize the Python-CFFI embedding logic:

Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named '_cffi_backend'

From: helheim_cffi
compiled with cffi version: 1.15.0
_cffi_backend module: not loaded
sys.path: ['/Library/Frameworks/Python.framework/Versions/3.10/lib/python310.zip', '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10', '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload', '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages']

function helheim_cffi.auth() called, but initialization code failed.  Returning 0.
2022/03/23 21:07:08 unexpected end of JSON input

@White2001Offl
Copy link
Author

Now I got this @bogdanfinn

@bogdanfinn
Copy link
Owner

@White2001Offl can you share some go code where you actually create the client?

@bogdanfinn
Copy link
Owner

@White2001Offl now it seems like the built cffi library is not "correct". might be due to the M1 but i'm not sure to be honest.

From: helheim_cffi
compiled with cffi version: 1.15.0
_cffi_backend module: not loaded
sys.path: ['/Library/Frameworks/Python.framework/Versions/3.10/lib/python310.zip', '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10', '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload', '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages']

according to this it seems that something is not installed or not found

@White2001Offl
Copy link
Author

I'll try in my windows VM and lyk

@White2001Offl
Copy link
Author

@bogdanfinn

I get this error in windows

# runtime/cgo
cgo: exec gcc: exec: "gcc": executable file not found in %PATH%

Should I've to download gcc?

@White2001Offl
Copy link
Author

After installing GCC, I get this error

# runtime/cgo
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lpython38
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lhelheim_cffi
collect2.exe: error: ld returned 1 exit status

@White2001Offl
Copy link
Author

my build.sh

go env -w CGO_LDFLAGS='-Wl,-rpath C:\Users\Administrator\AppData\Local\Programs\Python\Python38 -LC:\Users\Administrator\AppData\Local\Programs\Python\Python38 -lpython38 -lhelheim_cffi'
go env -w CGO_CFLAGS="-IC:\Users\ Administrator\AppData\Local\Programs\Python\Python38\include"

@bogdanfinn

@bogdanfinn
Copy link
Owner

@White2001Offl how do you build your app then? just go build main.go ?

There is btw a space in the path of the CGO_CFLAGS

@bogdanfinn
Copy link
Owner

@White2001Offl you can also contact me on Discord for a better discussion about your issues. You can find my Discord Tag in my profile.

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