简体   繁体   English

RCPP错误,在Mac上学习RCPP和C ++

[英]Rcpp error, learning Rcpp and C++ on mac

I've decided to start learning Rcpp and C++ so I can make aspects of my R code faster. 我决定开始学习Rcpp和C ++,以便可以更快地完成R代码的各个方面。 For a start I'm using the tutorial hadley has in the devtools wiki . 首先,我使用devtools Wiki中的hadley教程。 I have a c++ compiler on this machine in that it's a mac and I have xcode installed on it - I'm told that puts the c++ compiler on the machine. 我在这台机器上安装了c ++编译器,因为它是Mac,并且在上面安装了xcode-有人告诉我将c ++编译器放到了机器上。 I try to run the first example: 我尝试运行第一个示例:

cppFunction('
            int one(){
            return 1;
            }
            ')

However, what happens is: 但是,发生的是:

    sh: make: command not found

Error in sourceCpp(code = code, env = env, rebuild = rebuild, showOutput = showOutput,  : 
  Error 1 occurred building shared library.

I'm guessing I have a setup issue, but what to do I'm not sure. 我猜我有一个设置问题,但是我不确定该怎么办。 For a general C++ knowlege I've started reading Absolute C++ by Savitch, which so far does not actually tell you anything about setting up a machine with compiler etc, because you're instructed to use something called MyProgrammingLab which just tells you if you got the answer right or not and gives output, you don't go through the compilation or anything like that. 对于一般的C ++知识,我已经开始阅读Savitch的Absolute C ++,到目前为止,它实际上并未告诉您有关使用编译器设置计算机的任何信息,因为它被指示使用名为MyProgrammingLab的东西,它只会告诉您是否答案正确与否并给出输出,您无需进行任何编译或类似操作。

Thanks, Ben W. 谢谢,本W.

Errors of the type sh: foo: command not found are pretty obvious. sh: foo: command not found类型的错误sh: foo: command not found很明显。 You are lacking the make command. 您缺少make命令。 Install it, and try again. 安装它,然后再试一次。 Or if Xcode installs it outside of the path, add it to the path. 或者,如果Xcode将其安装在路径之外,则将其添加到路径中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM