-
Notifications
You must be signed in to change notification settings - Fork 26
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
rextendr::document(): linker fails with "undefined reference to `BCryptGenRandom'" #165
Comments
This is my guess: You need to have the active toolchain to be "stable-gnu", e.g. See But for now, just set the default building across everything to this by:
and try to see if this changes things. And go from there. |
I guess you created the package with the version before #156 gets merged, as no
You need to tweak your -PKG_LIBS = -L$(LIBDIR) -l{{{pkg_name}}} -lws2_32 -ladvapi32 -luserenv
+PKG_LIBS = -L$(LIBDIR) -l{{{pkg_name}}} -lws2_32 -ladvapi32 -luserenv -lbcrypt @Ilia-Kosenkov |
Yeah, I think we should try releasing after holidays, but not before we fix the problem with MacOS builds. |
I see. #166 will solve the issue. |
Thanks a lot @CGMossa , @yutannihilation and @Ilia-Kosenkov. Adding |
Thanks for confirming! Let me open this issue for a while so that the users can discover the solution when they hit the same error.
Sorry, I missed this comment. Maybe we should update it to match the latest template... |
@yutannihilation , I made an issue there extendr/helloextendr#12. Also, there is an error in the docs as pointed out in extendr/helloextendr#11. |
Thanks! |
This is already fixed in our templates, so will not be an issue once the next version of {rextendr} is on CRAN. |
as explained in extendr/rextendr#165
I have cloned the helloextendr repo and run
rextendr::document()
on a Windows 11 computer. This fails withcollect2.exe: error: ld returned 1 exit status
. Apparently, the linker could not find a reference to 'BCryptGenRandom'.Maybe this issue is related to #19.
Here's the full protocol. My environment is shown below.
rextendr
was freshly installed from github.R version:
version.string R version 4.1.2 (2021-11-01)
R Tools:
The latest version (4.0v2) found on https://cran.r-project.org/bin/windows/Rtools/rtools40.html .
Rust:
Prepared according to https://cran.r-project.org/bin/windows/Rtools/rtools40.html .
The text was updated successfully, but these errors were encountered: