AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
#Operatingsystems
#Servers
 View Only
  • 1.  getopt_long() in AIX

    Posted 05/24/12 01:12 AM

    Originally posted by: amar.nv


    While porting changes from Linux to AIX, I faced problem w.r.t getopt_long() function.

    I am using AIX 6.1.

    GCC version :

    Using built-in specs.
    Target: powerpc-ibm-aix6.1.0.0
    Configured with: ../gcc-4.4.6/configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran --prefix=/opt/freeware --enable-threads --enable-version-specific-runtime-libs --disable-nls --enable-decimal-float=dpd --host=powerpc-ibm-aix6.1.0.0
    Thread model: aix
    gcc version 4.4.6 (GCC)

    Also I came across article in IBM's technical library "Command Line Processing with getOpt()" where I can understand that I can use function getopt_long() on AIX as well.

    http://www.ibm.com/developerworks/aix/library/au-unix-getopt.html

    Question :

    Linux's getopt.h is part of AIX's unistd.h with an exception of getopt_long().

    During comilation, I get an error "error: 'getopt_long' was not declared in this scope".

    Please guide me, How can I reslove this issue.

    Thanks.
    #AIX-Forum


  • 2.  Re: getopt_long() in AIX

    Posted 12/12/15 03:16 AM

    Originally posted by: ravi.mijar


    How did you manage to get the getopt.h file in AIX? I followed the link you have mentioned, but it doesn't list any steps to get the getopt.h file.

    Did you have to install some rpms?

     

    On my AIX box, I couldn't find this .h file anywhere. Here are my compiler versions.

    /opt/IBM/xlc/13.1.2/

    -bash-4.2$ gcc --version
    gcc (GCC) 4.8.3

     

    Any info would be appreciated.

     


    #AIX-Forum


  • 3.  Re: getopt_long() in AIX

    Posted 05/04/16 05:37 AM

    Originally posted by: SowmyaGangishetty


    Hi Amar,

     

    getopt_long() is not available with AIX. 

    Even the below article which you referred also talks in general about UNIX, but it doesn't mention that getopt_long() works on AIX.

    http://www.ibm.com/developerworks/aix/library/au-unix-getopt.html

    Hope this helps you.


    #AIX-Forum