[PVFS-users] Linking Problem to libpvfs.a under glibc-2.1.2

Jeffrey B Layton jeffrey.b.layton@lmco.com
Thu, 12 Oct 2000 07:25:49 -0400


This is a multi-part message in MIME format.

--Boundary_(ID_3FfyYysFtfA7zQJbhNgM8g)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT

Hello,

   I'm trying to link a simple code to test using
PVFS. It's a Redhat 6.0 system, but upgraded
to glibc-2.1.2. The link statement looks like,

gcc test.o -o test -L/usr/pvfs/lib -lpvfs -lm

and I get the following error messages:

test.o: In function `main':
test.o(.text+0x8e): undefined reference to `pvfs_open'
/usr/pvfs/lib/libpvfs.a(getdents.o): In function `__getdents':
/usr/src/redhat/BUILD/pvfs/glibc2_1_2/glibc-2.1.2/dirent/../sysdeps/unix/sysv/linux/getdents.c:84:
undefined reference to `pvfs_getdents'
collect2: ld returned 1 exit status

It appears that I'm missing something. Could
someone help out? (Rob, I though posting to
the list would help other people besides me
:)  ).

Thanks,

Jeff

P.S. I'm attaching the code. But be warned
that my C is VERY rusty so I know there
are bugs in it.



--Boundary_(ID_3FfyYysFtfA7zQJbhNgM8g)
Content-type: text/plain; name=test.c; charset=us-ascii
Content-disposition: inline; filename=test.c
Content-transfer-encoding: 7BIT


/* C Code experiment for PVFS */
/*                            */

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pvfs.h> 

main()
{

   float *array1;    /* First Array */
   float *array2;    /* Second Array */
   int ndata;        /* Number of data points */
   int i;            /* Loop counter */
   char *pvfs_file;  /* PVFS Full Path File Name */
   int iresult;    /* Result of pvfs_open() operation */

   /* Define number of data points */
   ndata = 20;

   /* Allocate Array */
   array1 = (float *) malloc(sizeof(float)*ndata);

   /* Put data into Array */
   for (i = 0; i <= (ndata-1); i++)
   {
        array1[i]=i;
	printf(" *array[ %d ] = %f \n",i,array1[i]);
   }

   /* Define PVFS Full Path File name */
   pvfs_file = "/pvfs/jeff1.dat";

   /* Open PVFS File */
   iresult = pvfs_open(pvfs_file, O_RDWR);
   
   /* Write Data to PVFS File */
   
   /* Close PVFS File */
   
   /* Allocate another array */
   array2 = (float *) malloc(sizeof(float)*ndata);
   
   /* Open PVFS File */
   /* iresult = pvfs_open(pvfs_file, O_RDWR); */
   
   /* Read data into New array */
   
   /* Close PVFS File */
   
   /* Compare two arrays */
   
   /* Free memory */
   
   
   
   return 0;
}

--Boundary_(ID_3FfyYysFtfA7zQJbhNgM8g)--