-
Notifications
You must be signed in to change notification settings - Fork 738
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
link error undefined reference #1890
Comments
Bindgen doesn't take care of linking anything. Are you passing the right flags to rustc? Like |
@emilio
|
I started hitting something similar recently. More often than not it is because rustc reorders the |
@nagisa How to resolve it ? Thanks |
I think this is not a bindgen issue itself given the above... But a minimal repro would go a long way. Please reopen if this turns out to be an issue that should be fixed in bindgen. |
@emilio bindgen currently does not provide the means to add |
I'm a bindgen novice, but am confused why this isn't a bigger problem for users. I have to edit the generated bindings to add |
I totally agree with @mrozekma , and I do think it's a big problem for me as I need to add |
I link c++ libray (libmylib.so ) , with g++ -lmylib , It works ok, and link success,
But with rust ,I have pass the -lmylib, compiles ok, and always link error:
'
/usr/bin/ld: callc.d2qs7r1b-cgu.0:(.text._ZN5callc4main17h70fed83690e9e7b8E+0x106): undefined reference to
USB5622E_GetNetCfgA' /usr/bin/ld: callc.d2qs7r1b-cgu.0:(.text._ZN5callc4main17h70fed83690e9e7b8E+0x351): undefined reference to
USB5622E_AI_GetRateInfo'/usr/bin/ld: callc.d2qs7r1b-cgu.0:(.text._ZN5callc4main17h70fed83690e9e7b8E+0x4d0): undefined reference to
USB5622E_AI_VerifyParam' /usr/bin/ld: callc.d2qs7r1b-cgu.0:(.text._ZN5callc4main17h70fed83690e9e7b8E+0x4f7): undefined reference to
USB5622E_AI_InitTask'/usr/bin/ld: callc.d2qs7r1b-cgu.0:(.text._ZN5callc4main17h70fed83690e9e7b8E+0x508): undefined reference to
USB5622E_AI_StartTask' /usr/bin/ld: callc.d2qs7r1b-cgu.0:(.text._ZN5callc4main17h70fed83690e9e7b8E+0x581): undefined reference to
USB5622E_AI_SendSoftTrig'/usr/bin/ld: callc.d2qs7r1b-cgu.0:(.text._ZN5callc4main17h70fed83690e9e7b8E+0x5a0): undefined reference to
USB5622E_AI_ReadBinary' /usr/bin/ld: callc.d2qs7r1b-cgu.0:(.text._ZN5callc4main17h70fed83690e9e7b8E+0x875): undefined reference to
USB5622E_DEV_Release'/usr/bin/ld: callc.d2qs7r1b-cgu.0:(.text._ZN5callc4main17h70fed83690e9e7b8E+0x961): undefined reference
'
The text was updated successfully, but these errors were encountered: