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

error: use of undeclared identifier 'getpwent' #351

Closed
leechaowen opened this issue Nov 11, 2021 · 1 comment
Closed

error: use of undeclared identifier 'getpwent' #351

leechaowen opened this issue Nov 11, 2021 · 1 comment

Comments

@leechaowen
Copy link

leechaowen commented Nov 11, 2021

install R in termux by phone. how to fix this error? Could you mind take some time to view how to fix it? Thanks.

many useful packages depend on fs .

~ $ R

R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages("fs")
trying URL 'https://mirrors.bfsu.edu.cn/CRAN/src/contrib/fs_1.5.0.tar.gz'
Content type 'application/octet-stream' length 796244 bytes (777 KB)
==================================================
downloaded 777 KB

* installing *source* package ‘fs’ ...
** package ‘fs’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++14 -I"/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -g -O2  -c dir.cc -o dir.o
g++ -std=gnu++14 -I"/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -g -O2  -c error.cc -o error.o
g++ -std=gnu++14 -I"/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -g -O2  -c file.cc -o file.o
g++ -std=gnu++14 -I"/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -g -O2  -c fs.cc -o fs.o
g++ -std=gnu++14 -I"/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -g -O2  -c getmode.cc -o getmode.o
g++ -std=gnu++14 -I"/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -g -O2  -c id.cc -o id.o
id.cc:109:17: error: use of undeclared identifier 'getpwent'; did you mean 'getgrent'?
  passwd* pwd = getpwent();
                ^~~~~~~~
                getgrent
/data/data/com.termux/files/usr/include/grp.h:55:22: note: 'getgrent' declared here
static struct group* getgrent(void) { return 0; }
                     ^
id.cc:109:11: error: cannot initialize a variable of type 'passwd *' with an rvalue of type 'struct group *'
  passwd* pwd = getpwent();
          ^     ~~~~~~~~~~
id.cc:113:11: error: use of undeclared identifier 'getpwent'; did you mean 'getgrent'?
    pwd = getpwent();
          ^~~~~~~~
          getgrent
/data/data/com.termux/files/usr/include/grp.h:55:22: note: 'getgrent' declared here
static struct group* getgrent(void) { return 0; }
                     ^
id.cc:113:11: error: incompatible pointer types assigning to 'passwd *' from 'struct group *'
    pwd = getpwent();
          ^~~~~~~~~~
4 errors generated.
make: *** [/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/etc/Makeconf:173: id.o] Error 1
ERROR: compilation failed for package ‘fs’
* removing ‘/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/library/fs’

The downloaded source packages are in
        ‘/data/data/com.termux/files/usr/tmp/Rtmpe1qXoQ/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("fs") :
  installation of package ‘fs’ had non-zero exit status
@gaborcsardi
Copy link
Member

This is a duplicate of #349.

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

2 participants