[p4perl] It's not a crash on takeoff if you can't build the plane

Tim McDaniel tmcd at panix.com
Tue Apr 7 11:15:55 PDT 2009


I've made some progress in trying to get "use P4;" to work under
Cygwin, despite Perforce's site having little pertinent information.

I downloaded
ftp://ftp.perforce.com/perforce/r08.2/bin.cygwinx86/p4api.tgz
(after following poorly lit rabbit holes to find it).

I tried going into the cpan program and doing "install P4".  After
some experimentation and code reading, the way I got it to work was to
take all the files in the untarred p4api.tgz and copy them into one
directory without subdirectories.  (Without file Version from the
samples directory, "cpan make P4" would give me "Where is the Perforce
API to be found:" silently looping, which it always does on relative
paths.  Without the include files and libs in the same directory, I
would get "Note (probably harmless): No library found for -lclient"
and lrpc and -lsupp, and "p4result.cc:38:23: clientapi.h: No such file
or directory" and lots more errors.)

Having gotten that far, "force make P4" gives me

     Writing Makefile for P4::lib
     Writing Makefile for P4
     cd lib && make
     make[1]: Entering directory `/home/tmcdaniel/.cpan/build/P4-3.5313-0EZ5l6/lib'
     g++ -c  -I/c/download/Perforce/Cygwin/API/mashup -Ilib -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing -pipe -I/usr/local/include -DUSEIMPORTLIB -O3   -DVERSION=\"\" -DXS_VERSION=\"\"  "-I/usr/lib/perl5/5.10/i686-cygwin/CORE"  -DOS_CYGWIN -Dconst_char='char' -DP4API_VERSION=514050 perlclientapi.cc
     In file included from perlclientapi.cc:56:
     perlclientuser.h:50: error: conflicting return type specified for `virtual void PerlClientUser::OutputText(char*, int)'
     /c/download/Perforce/Cygwin/API/mashup/clientuser.h:161: error:   overriding `virtual int ClientUser::OutputText(char*, int)'
     perlclientuser.h:51: error: conflicting return type specified for `virtual void PerlClientUser::OutputInfo(char, char*)'
     /c/download/Perforce/Cygwin/API/mashup/clientuser.h:157: error:   overriding `virtual int ClientUser::OutputInfo(char, char*)'
     perlclientuser.h:53: error: conflicting return type specified for `virtual void PerlClientUser::OutputBinary(char*, int)'
     /c/download/Perforce/Cygwin/API/mashup/clientuser.h:159: error:   overriding `virtual int ClientUser::OutputBinary(char*, int)'
     perlclientapi.cc: In member function `SV* PerlClientApi::ParseSpec(const char*, const char*)':
     perlclientapi.cc:426: error: no matching function for call to `Spec::Spec(char*, const char[1])'
     /c/download/Perforce/Cygwin/API/mashup/spec.h:153: note: candidates are: Spec::Spec(const Spec&)
     /c/download/Perforce/Cygwin/API/mashup/spec.h:157: note:  Spec::Spec(const char*, const char*, Error*)
     /c/download/Perforce/Cygwin/API/mashup/spec.h:156: note:  Spec::Spec()
     make[1]: *** [perlclientapi.o] Error 1
     make[1]: Leaving directory `/home/tmcdaniel/.cpan/build/P4-3.5313-0EZ5l6/lib'
     make: *** [lib/libp4.a] Error 2
       SMEE/P4-3.5313.tar.gz
       /usr/bin/make -- NOT OK
     Failed during this command:
      SMEE/P4-3.5313.tar.gz                        : make NO

<http://maillist.perforce.com/pipermail/p4perl/2007q3/000291.html>
looks vaguely similar, so maybe (as with that question) I just need an
earlier version of the API.

I'm using the most recent Cygwin, g++ and "gcc version 3.4.4 (cygming
special, gdc 0.12, using dmd 0.125)", Perforce "Server version:
P4D/LINUX26X86/2007.3/143793 (2008/01/09)".

-- 
Tim McDaniel, tmcd at panix.com



More information about the p4perl mailing list