首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法安装`proj4`包,因为在标准搜索位置找不到libproj和/或proj_api.h

无法安装`proj4`包,因为在标准搜索位置找不到libproj和/或proj_api.h
EN

Stack Overflow用户
提问于 2019-05-25 19:58:07
回答 2查看 3.2K关注 0票数 5

我想安装需要安装proj4包的ggalt包,但是当我安装proj4时,它抛出了一个错误libproj and/or proj_api.h not found in standard search locations

我的电脑是Mac,我用brew install proj安装了PROJ.4,R的版本是3.6.0_2。我在网上搜索这个问题,但没有找到解决它的方法。我不是一个程序员,刚刚开始学习R,所以我现在不知道该怎么做。

错误信息如下:

代码语言:javascript
运行
复制
* installing *source* package ‘proj4’ ...
** package ‘proj4’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
checking for pj_init_plus in -lproj... yes
configure: error: libproj and/or proj_api.h not found in standard search locations.

*** Install PROJ.4 and if necessary set PKG_CPPFLAGS/PKG_LIBS accordingly.
ERROR: configuration failed for package ‘proj4’
* removing ‘/usr/local/lib/R/3.6/site-library/proj4’

The downloaded source packages are in
    ‘/private/var/folders/sn/1d6n55qs0zl522kcc769jq5h0000gn/T/RtmpNOkU64/downloaded_packages’
EN

回答 2

Stack Overflow用户

发布于 2020-10-15 11:15:26

我正在运行Pop!_OS 20.04 (Ubuntu fork),并且遇到了proj4未安装(R 3.6.3)的相同问题。我不相信libproj已经安装好了。我可以使用以下命令通过终端手动完成此操作:

sudo apt-get install libproj-dev

我重新启动了R,并且能够安装proj4

票数 6
EN

Stack Overflow用户

发布于 2019-06-17 00:24:12

我也遇到了这个烦人的问题。我可以手动构建它-但目前它是一个肮脏的黑客。请注意,我不是一个C程序员,所以它不会被修复。

我在proj_api.h的顶部找到的

代码语言:javascript
运行
复制
#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
#endif

我想我可以插入

代码语言:javascript
运行
复制
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H

src/p4.c中的第7行和包源的configure的1462行之前(两种情况下都是在#include之前)。

我想也可以从proj_api.h中删除这个部分--但是我一点也不知道它是否会破坏任何东西。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56304632

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档