AIX

AIX

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


#Power
 View Only
  • 1.  Compiling putty on AIX 5.2 w/ gcc3.4.3

    Posted Wed July 18, 2007 03:39 PM

    Originally posted by: SystemAdmin


    I'm trying to install putty on my AIX 5.2 p615 box. I just need the cmd line stuff, specifically pscp. However I'm getting a compile error that I don't know how to resolve and I'm hoping someone here might have seen this before. During the 'make' phase I see this:

    gcc -g -O2 -Wall -Werror -DHAVE_CONFIG_H -I.././ -I../charset/ -I../windows/
    -I../unix/ -I../mac/ -I../macosx/ -c ../misc.c
    ../misc.c: In function `dupvprintf':
    ../misc.c:240: warning: implicit declaration of function `vsnprintf'
    make: *** http://misc.o Error 1

    I've google'd this one to no avail.

    Has anyone got thoughts on how to get around this issue?

    Thanks,
    MC
    #AIX-Forum


  • 2.  Re: Compiling putty on AIX 5.2 w/ gcc3.4.3

    Posted Wed July 18, 2007 03:46 PM

    Originally posted by: SystemAdmin


    Why not use scp from ssh?
    #AIX-Forum


  • 3.  Re: Compiling putty on AIX 5.2 w/ gcc3.4.3

    Posted Wed July 18, 2007 04:01 PM

    Originally posted by: SystemAdmin


    > Why not use scp from ssh?

    I'm stuck in a situation where I need to automate the uploading of various files to an SFTP server, but the business partner on the other end (who controls the server) has set up password authentication instead of using keys. I have to be able to supply the authentication password from within a script. I didn't see that option available with scp. However, if you know how it can be done then I'd be extremely interested in knowing more.

    Thanks!

    -MC
    #AIX-Forum


  • 4.  Re: Compiling putty on AIX 5.2 w/ gcc3.4.3

    Posted Wed July 18, 2007 04:47 PM

    Originally posted by: rayhiggs


    The compiler wants a function prototype for vsnprintf(). The man page:

    http://publib16.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/basetrf2/vsnprintf.htm#a091297103409

    says that you need to include both stdio.h, and stdarg.h. If you have those included, and you still have problems, take a look at them. There is probably some ifdef'ing.

    If you just want this to compile and don't care about figuring everything out, you might be able to just put the prototype at the top of misc.c:

    int vsnprintf(char * s, size_t n, const char * format, va_list ap);
    #AIX-Forum


  • 5.  Re: Compiling putty on AIX 5.2 w/ gcc3.4.3

    Posted Wed July 18, 2007 07:02 PM

    Originally posted by: SystemAdmin



    > If you just want this to compile and don't care about
    > figuring everything out, you might be able to just
    > put the prototype at the top of misc.c:
    >
    > int vsnprintf(char * s, size_t n, const char *
    > format, va_list ap);

    Ray,

    That worked! It turns out that both vsnprintf and snprintf needed some coaxing, and then only in two different files, misc.c and uxnet.c, respectively. Manually adding the prototypes right after the preprocessor directives definitely did the trick and I've got a working pscp on my system.

    Thanks!
    -MC
    #AIX-Forum


  • 6.  Re: Compiling putty on AIX 5.2 w/ gcc3.4.3

    Posted Fri July 20, 2007 11:37 AM

    Originally posted by: SystemAdmin


    > gcc -g -O2 -Wall -Werror -DHAVE_CONFIG_H -I.././
    > -I../charset/ -I../windows/
    > -I../unix/ -I../mac/ -I../macosx/ -c ../misc.c
    > ../misc.c: In function `dupvprintf':
    > ../misc.c:240: warning: implicit declaration of
    > function `vsnprintf'
    > make: *** http://misc.o Error 1

    FYI, it turns out that in two of the source files there is a problem with finding the appropriate prototype for a pair of related functions. On my system, the stdio.h file has these prototypes but for some reason there is a failure during compilation. Ray's suggestion, manually put the prototype directly in the source file, worked for me. I had these two files with these two prototypes:

    misc.c and vsnprintf
    uxnet.c and snprintf

    In both cases I copied the prototype for each function right out of the header file (in /usr/include/stdio.h) and pasted it into the source file. I chose to put the prototype in the source file immediately following all of the preprocessor directives. Like Ray said, there could very well be some #ifdef weirdness taking place.

    Thanks to all of those who offered suggestions on this issue.

    -MC
    #AIX-Forum