C++ 错误:boost/scoped_ptr.hpp:使用 libkml 时没有这样的文件或目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19480020/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 22:53:20  来源:igfitidea点击:

Error: boost/scoped_ptr.hpp: No such file or directory while using libkml

c++google-maps

提问by GV vo

I am developing a software which uses Google Map database. I searched google and I found a library in C++ can do that - libkml. I've downloaded some examples code in this website, but when I compiled with this command: g++ main.cpp -lkml, it occured an error:

我正在开发一个使用谷歌地图数据库的软件。我搜索了谷歌,发现一个 C++ 库可以做到这一点 - libkml。我已经在这个网站下载了一些示例代码,但是当我用这个命令编译时g++ main.cpp -lkml,它发生了一个错误:

fatal error: boost/scoped_ptr.hpp: No such file or directory

What is "boost/scoped_ptr.hpp"? I try finding this file in terminal

什么是“boost/scoped_ptr.hpp”?我尝试在终端中找到这个文件

locate boost/scoped_ptr.hpp 

but there's nothing.

但什么都没有。

回答by hogliux

You need to install the boost libraries from http://www.boost.org/

您需要从http://www.boost.org/安装 boost 库

Depending on your OS there will be pre-built solutions that you can install. For example on Ubuntu you can do sudo apt-get install libboost-all-dev. On Mac see this thread Boost: MacOSX binaries for BoostOn Windows this may help: http://boost.teeks99.com/

根据您的操作系统,您可以安装预先构建的解决方案。例如在 Ubuntu 上你可以做sudo apt-get install libboost-all-dev. 在 Mac 上看到这个线程Boost: MacOSX binaries for BoostOn Windows 这可能有帮助:http: //boost.teeks99.com/