首页 \ 问答 \ apt-get安装后找不到LLVM头(LLVM header not found after apt-get install)

apt-get安装后找不到LLVM头(LLVM header not found after apt-get install)

我使用LLVM Nightly软件包链接中提供的以下命令安装了llvmclang 3.9以及所有其他软件包。

sudo apt-get install clang-3.9 clang-3.9-doc llvm-3.9 llvm-3.9-dev llvm-3.9-doc llvm-3.9-examples llvm-3.9-runtime clang-format-3.9 python-clang-3.9 libclang-common-3.9-dev libclang-3.9-dev libclang1-3.9 libclang1-3.9-dbg libllvm-3.9-ocaml-dev libllvm3.9 libllvm3.9-dbg lldb-3.9 lldb-3.9-dev liblldb-3.9-dbg

然后,我尝试编译并运行本教程中的万花筒语言样例词法分析器和解析器。

但是,我无法编译给定的示例程序,因为我收到错误消息:

clang++-3.9 -g -O3 toy.cpp
toy.cpp:1:10: fatal error: 'llvm/ADT/STLExtras.h' file not found
#include "llvm/ADT/STLExtras.h"
         ^
1 error generated.

我认为这个错误是因为LLVM被安装为llvm-3.9 ,因此所有文件都安装在以*-3.9结尾的目录中。 我怎样才能解决这个错误,而不必删除安装,并从LLVM源手动构建安装?


I installed llvm and clang 3.9 along with all the other packages using the below command as given in LLVM Nightly packages link.

sudo apt-get install clang-3.9 clang-3.9-doc llvm-3.9 llvm-3.9-dev llvm-3.9-doc llvm-3.9-examples llvm-3.9-runtime clang-format-3.9 python-clang-3.9 libclang-common-3.9-dev libclang-3.9-dev libclang1-3.9 libclang1-3.9-dbg libllvm-3.9-ocaml-dev libllvm3.9 libllvm3.9-dbg lldb-3.9 lldb-3.9-dev liblldb-3.9-dbg

Then I tried to compile and run the sample lexer and parser for kaleidoscope language according to this tutorial.

However, I am not able to compile the given sample program, because I get the error:

clang++-3.9 -g -O3 toy.cpp
toy.cpp:1:10: fatal error: 'llvm/ADT/STLExtras.h' file not found
#include "llvm/ADT/STLExtras.h"
         ^
1 error generated.

I think this error is because LLVM was installed as llvm-3.9 and hence all the files were installed in directories ending with *-3.9. How can I fix this error without having to remove the installation and do a manual build install from the LLVM source?


原文:https://stackoverflow.com/questions/40307876
更新时间:2022-06-09 06:06

最满意答案

以下是在服务中调用的一个示例方法

const express = require('express');

const app = express();
const request = require('request');

app.post('/deleteFavorites', (req, res) => {
    req.body = [
        {"id": "123"},
        {"id":"124"},
    ]

    console.log("deleteFavorites was called?")
    request.delete({
        url: "http://" + req.headers.host + "/favorites/delete",
        body: req.body,
        json: true
    }, function(error, response, body){
        console.log(body, error, response);
        res.status(200).send("all good");
    });

});

app.delete('/favorites/delete', (req, res) => {
    console.log("favorites/delete was called?")
    res.status(200).send("all good");

});

app.listen(9090);

理想的方法是通过可重用功能来完成,但由于您提到这不是一种选择,所以这是另一种可以使用的方法。

但我建议将其限制为一次调用而不是多次调用,否则可能会导致服务器发生请求爆炸。 如果您在服务器中发送100个ID /deleteFavorites ,那么也可能会在服务器上请求导致其中大多数超时


Here is an example way of calling within the service

const express = require('express');

const app = express();
const request = require('request');

app.post('/deleteFavorites', (req, res) => {
    req.body = [
        {"id": "123"},
        {"id":"124"},
    ]

    console.log("deleteFavorites was called?")
    request.delete({
        url: "http://" + req.headers.host + "/favorites/delete",
        body: req.body,
        json: true
    }, function(error, response, body){
        console.log(body, error, response);
        res.status(200).send("all good");
    });

});

app.delete('/favorites/delete', (req, res) => {
    console.log("favorites/delete was called?")
    res.status(200).send("all good");

});

app.listen(9090);

The ideal way is to do it through re-usable functions but since you mentioned that is not an option, this is another possible approach one can use.

But I would recommend to limit it to one call instead of multiple calls, else you may cause a request explosion at the server. If you send 100 ids at server in /deleteFavorites then that would raise too may request at server causing most of them to timeout

相关问答

更多

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)