- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: error: 'rexec' was not declared in this scope
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2012 01:49 PM
тАО10-22-2012 01:49 PM
Simple program:
#include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <netinet/in.h> #include <netdb.h> int main(int argc, char **argv) { int ret = rexec((char**) 0, "", "", "", 0); return 0; }
g++ -o rexec -D_XOPEN_SOURCE_EXTENDED rexec.cpp
rexec.cpp: In function 'int main(int, char**)': rexec.cpp:10:49: error: 'rexec' was not declared in this scope
ref: http://stackoverflow.com/questions/12955644/rexec-not-found-in-hp-ux
where is 'rexec' ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2012 04:01 PM - edited тАО10-22-2012 04:04 PM
тАО10-22-2012 04:01 PM - edited тАО10-22-2012 04:04 PM
Re: error: 'rexec' was not declared in this scope
>where is rexec ?
It's in <sys/socket.h> but you can't compile with -D_XOPEN_SOURCE_EXTENDED since rexec(3) isn't in that namespace.
And you have the wrong number/type of parms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2012 04:01 PM
тАО10-22-2012 04:01 PM
Re: error: 'rexec' was not declared in this scope
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2012 06:25 AM - edited тАО10-23-2012 06:26 AM
тАО10-23-2012 06:25 AM - edited тАО10-23-2012 06:26 AM
Re: error: 'rexec' was not declared in this scope
[gimenero@rx8km ~]$ uname -a
HP-UX rx8km B.11.31 U ia64 2229485251 unlimited-user license
[gimenero@rx8km ~]$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/hp-gcc-4.7.0/libexec/gcc/ia64-hp-hpux11.23/4.7.0/lto-wrapper
Target: ia64-hp-hpux11.23
Configured with: /tmp/gcc-4.7.0.tar.gz/gcc-4.7.0/configure --host=ia64-hp-hpux11.23 --target=ia64-hp-hpux11.23 --build=ia64-hp-hpux11.23 --prefix=/opt/hp-gcc-4.7.0 --with-gnu-as --without-gnu-ld --enable-threads=posix --enable-languages=c,c++ --with-gmp=/proj/opensrc/be/ia64-hp-hpux11.23 --with-mpfr=/proj/opensrc/be/ia64-hp-hpux11.23
SED=/usr/bin/sed
Thread model: posix
gcc version 4.7.0 (GCC)
i'm compiling with -D_XOPEN_SOURCE_EXTENDED because that compiles most of my ported code (from solaris). What flag should I use so the code can be portable between linux, solaris and hp-ux?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2012 06:40 AM
тАО10-23-2012 06:40 AM
Re: error: 'rexec' was not declared in this scope
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2012 07:11 AM
тАО10-23-2012 07:11 AM
Re: error: 'rexec' was not declared in this scope
the problem is that with _XOPEN_SOURCE_EXTENDED i can compile all my code but this, is there a flag that i can add so 'rexec' whould appear? i mostly use the boost libraries so i save a lot of portability issues with it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2012 07:35 AM
тАО10-23-2012 07:35 AM
Re: error: 'rexec' was not declared in this scope
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2012 12:41 PM
тАО10-23-2012 12:41 PM
Re: error: 'rexec' was not declared in this scope
i've just declared it myself:
int rexec (char **, int, const char *, const char *, const char *, int *);
in that particular program, it compiles, but in another bigger one, the symbol is missing:
ld: Unsatisfied symbol "rexec(char**, int, char const*, char const*, char const*, int*)" in file ...
do you know in which library is 'rexec' ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2012 02:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2012 02:27 PM
тАО10-23-2012 02:27 PM
Re: error: 'rexec' was not declared in this scope
>I'm compiling with -D_XOPEN_SOURCE_EXTENDED because that compiles most of my ported code (from solaris).
Does the default -D_HPUX_SOURCE compile everything?
>but "#ifndef _XOPEN_SOURCE_EXTENDED" looks to me to be rather rigid.
Right, rexec isn't part of that namespace.
>do you know in which library is 'rexec' ?
libc.so.1
>ld: Unsatisfied symbol "rexec(char**, int, char const*, char const*, char const*, int*)" in file ...
As Steven said, you forgot to C++ify your source with extern "C". You have an unsat with a mangled name.