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

Fails when file name is cpp11.cpp #133

Closed
dfalbel opened this issue Nov 27, 2020 · 0 comments
Closed

Fails when file name is cpp11.cpp #133

dfalbel opened this issue Nov 27, 2020 · 0 comments

Comments

@dfalbel
Copy link

dfalbel commented Nov 27, 2020

cpp_source fails when the source file is called cpp11.cpp:
It will also fail if the file name contains . or -, but the error messages here are more informative.

writeLines('
[[cpp11::register]]
int add(int x, int y, int z) {
  int sum = x + y + z;
  return sum;
}', "cpp11.cpp")

cpp11::cpp_source("cpp11.cpp")
#> Error in (function (command = NULL, args = character(), error_on_status = TRUE, : System command 'R' failed, exit status: 1, stderr:
#> E> duplicate symbol '__cpp11_add' in:
#> E>     /private/var/folders/x0/fqbv9_ys1lq55xqjqbqllzqm0000gn/T/RtmpbkL1uf/file215a3ddf389a/src/cpp11.o
#> E> ld: 1 duplicate symbol for architecture x86_64
#> E> clang: error: linker command failed with exit code 1 (use -v to see invocation)
#> E> make: *** [/private/var/folders/x0/fqbv9_ys1lq55xqjqbqllzqm0000gn/T/RtmpbkL1uf/file215a3ddf389a/src/cpp11.so] Error 1

Created on 2020-11-27 by the reprex package (v0.3.0)

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

1 participant