- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ld: Unsatisfied symbol "getopt_long" in file
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
Forums
Discussions
Discussions
Discussions
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
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-17-2017 06:45 AM
10-17-2017 06:45 AM
ld: Unsatisfied symbol "getopt_long" in file
I am compling from source code. I am getting the below error. I have tried multiple things but nothing has worked.
ld: Unsatisfied symbol "getopt_long" in file ./.libs/liboathtool_cmd.a[liboathtool_cmd_la-oathtool_cmd.o]
1 error.
collect2: ld returned 1 exit status
*** Error exit code 1Stop.
*** Error exit code 1Stop.
*** Error exit code 1Stop.
*** Error exit code 1Stop.
*** Error exit code 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2017 08:16 AM
10-17-2017 08:16 AM
Re: ld: Unsatisfied symbol "getopt_long" in file
> [...] I have tried multiple things [...]
That's not very informative.
I know nothing, but isn't getopt_long() a GNU libc feature?
Presumably, one could extract some getopt_long()-containing C source
code from the glibc source collection, rather than trying to build/find
the whole thing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2017 08:41 AM
10-17-2017 08:41 AM
Re: ld: Unsatisfied symbol "getopt_long" in file
@Steven Schweda wrote:> [...] I have tried multiple things [...]
That's not very informative.
I know nothing, but isn't getopt_long() a GNU libc feature?
Presumably, one could extract some getopt_long()-containing C source
code from the glibc source collection, rather than trying to build/find
the whole thing.
I am sorry for the useless information I gave. I'll Describe my problem in Breif.
I am trying to compile oathtool from source code in HP-UX 11.31. While Compling I am getting the error ld: Unsatisfied symbol "getopt_long" in file. I am not trying to compile getopt_long.
Things to note -
I manually copy pasted the getopt.h from the web. As I couldn't find it in the HP-UX machine and had put it in the lib directory.
Things I tried -
Tried Hashing it out in the Makefile.
tried manually running it with aCC
aclocal autoheader autoconf autoreconf and none worked till now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2017 11:45 AM
10-17-2017 11:45 AM
Re: ld: Unsatisfied symbol "getopt_long" in file
> [...] I am not trying to compile getopt_long.
You may need to. If it's not in the HP-UX C RTL, and you don't have
the GNU C RTL, then compiling the source seems to me like the thing to
do.
> I manually copy pasted the getopt.h from the web. [...]
That's a start. Keep going.
> [...] had put it in the lib directory.
I'd keep it separate from the standard HP-UX files. That may force
you to play with your compile (-I) and/or link (-L,-l) options, but I
wouldn't mess with the standard files.
> Things I tried -
> [...]
If the code wants getopt_long(), then you need to change the code, or
else give it a getopt_long(). On a GNU/Linux system, you'd have the GNU
C RTL (glibc), which should include it. On HP-UX, if it's not already
there, then you need to get it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2017 10:27 PM - edited 10-18-2017 05:05 AM
10-17-2017 10:27 PM - edited 10-18-2017 05:05 AM
Re: ld: Unsatisfied symbol "getopt_long" in file
@Steven Schweda wrote:> [...] I am not trying to compile getopt_long.
You may need to. If it's not in the HP-UX C RTL, and you don't have
the GNU C RTL, then compiling the source seems to me like the thing to
do.
> I manually copy pasted the getopt.h from the web. [...]
That's a start. Keep going.
> [...] had put it in the lib directory.
I'd keep it separate from the standard HP-UX files. That may force
you to play with your compile (-I) and/or link (-L,-l) options, but I
wouldn't mess with the standard files.
> Things I tried -
> [...]
If the code wants getopt_long(), then you need to change the code, or
else give it a getopt_long(). On a GNU/Linux system, you'd have the GNU
C RTL (glibc), which should include it. On HP-UX, if it's not already
there, then you need to get it.
I am not a developer. I just downloaded the source code from the website and compiled the code. It would be helpful if you could help elobrate on the solution.
Edit - So, I did do a little digging and found that the Makefile was excuting the below command
./libtool --silent --tag=CC --mode=link gcc -std=gnu99 -g -O2 -o oathtool oathtool.o gl/libgnu.la liboathtool_cmd.la
and throwing the exact below error while make-"ing".
libtool: link: gcc -std=gnu99 -g -O2 -o .libs/oathtool oathtool.o -L../liboath/.libs -loath gl/.libs/libgnu.a ./.libs/liboathtool_cmd.a -Wl,+b -Wl,/usr/local/lib
ld: Unsatisfied symbol "getopt_long" in file ./.libs/liboathtool_cmd.a[liboathtool_cmd_la-oathtool_cmd.o]
1 error.
collect2: ld returned 1 exit status
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2017 10:47 AM
10-18-2017 10:47 AM
Re: ld: Unsatisfied symbol "getopt_long" in file
> I am not a developer.
Find one? Become one?
> I just downloaded the source code from the website and compiled the
> code.
Complain to the people who provide this package?
> It would be helpful if you could help elobrate on the solution.
There's not much to elaborate. The program uses getopt_long(). If
that's not provided in the HP-UX run-time libraries, then you would need
to provide it yourself. You found getopt.h. I'd guess that something.c
with getopt_long() in it shouldn't be far away.
Assuming that "the website" is http://www.nongnu.org/oath-toolkit/ ,
I didn't notice anything there about operating systems where the program
is expected to run, so they may assume that if GNU/Linux has it, then
everyone else must have it, too.
> Edit - So, I did do a little digging [...]
Yes, that's where it would happen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2017 03:18 AM
10-23-2017 03:18 AM
Re: ld: Unsatisfied symbol "getopt_long", missing Linux feature
> isn't getopt_long() a GNU libc feature?
Yes. It would have to be ported. Or converted to use getopt(3).