Mail Archives: cygwin/2009/08/03/10:50:35
I am trying to compile a huge collection of old code libraries
originally written for linux/unix (it manipulates genomic data) for
windows using cygwin/mingw32-make and have been successful up to =A0the
last stage where I am getting the following error in class chromAnn.
>> chromAnn.c: In function `strVectorWrite':
>> chromAnn.c:119: warning: implicit declaration of function `putc_unlocked'
>> mingw32-make: *** [chromAnn.o] Error 1
I have searched and seen some information about missing definitions
etc. but am not sure how to correct this problem - or is there a more
recent code substitution for putc_unlocked and its compadres so the
stdio.h library definitions become irrelevant.
Any help on how to resolve the issue would be appreciated. The start
of the class follows. Compilation is on 64bit vista. A great number of
classes have compile no probs at all.
Cheers
Dennis Gascoigne
dennis DOT gascoigne AT gmail DOT com
> /* chromAnn - chomosome annotations, generic object to store annotations =
from
> =A0* other formats */
> #include "common.h"
> #include "chromAnn.h"
> #include "binRange.h"
> #include "rowReader.h"
> #include "psl.h"
> #include "bed.h"
> #include "chain.h"
> #include "genePred.h"
> #include "coordCols.h"
> #include "verbose.h"
> #include "stdio.h"
> static struct chromAnnBlk* chromAnnBlkNew(struct chromAnn *ca, int start,=
int end)
> /* create new block object and add to chromAnn object */
> {
> struct chromAnnBlk* caBlk;
> AllocVar(caBlk);
> if (end < start)
> =A0=A0 =A0errAbort("invalid block coordinates for %s: start=3D%d end=3D%d=
", ca->name, start, end);
> caBlk->ca =3D ca;;
> caBlk->start =3D start;
> caBlk->end =3D end;
> if (ca->blocks =3D=3D NULL)
> =A0=A0 =A0{
> =A0=A0 =A0ca->start =3D start;
> =A0=A0 =A0ca->end =3D end;
> =A0=A0 =A0}
> else
> =A0=A0 =A0{
> =A0=A0 =A0ca->start =3D min(ca->start, start);
> =A0=A0 =A0ca->end =3D max(ca->end, end);
> =A0=A0 =A0}
> ca->totalSize +=3D (end - start);
> slAddHead(&ca->blocks, caBlk);
> return caBlk;
> }
> static void chromAnnBlkFreeList(struct chromAnnBlk *blks)
> /* free list of objects */
> {
> struct chromAnnBlk *blk;
> while ((blk =3D slPopHead(&blks)) !=3D NULL)
> =A0=A0 =A0freeMem(blk);
> }
> static struct chromAnn* chromAnnNew(char* chrom, char strand, char* name,=
void *rec,
> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0void (*recWrite)(struct chromAnn*, FILE *, char),
> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0void (*recFree)(struct chromAnn *))
> /* create new object, ownership of rawCols is passed */
> {
> struct chromAnn* ca;
> AllocVar(ca);
> ca->chrom =3D cloneString(chrom);
> ca->strand =3D strand;
> if (name !=3D NULL)
> =A0=A0 =A0ca->name =3D cloneString(name);
> ca->start =3D 0;
> ca->end =3D 0;
> ca->rec =3D rec;
> ca->recWrite =3D recWrite;
> ca->recFree =3D recFree;
> return ca;
> }
> static int chromAnnBlkCmp(const void *va, const void *vb)
> /* sort compare of two chromAnnBlk objects */
> {
> const struct chromAnnBlk *a =3D *((struct chromAnnBlk **)va);
> const struct chromAnnBlk *b =3D *((struct chromAnnBlk **)vb);
> int diff =3D a->start - b->start;
> if (diff =3D=3D 0)
> =A0=A0 =A0diff =3D a->end - b->end;
> return diff;
> }
> static void chromAnnFinish(struct chromAnn* ca)
> /* finish creation of a chromAnn after all blocks are added */
> {
> slSort(&ca->blocks, chromAnnBlkCmp);
> }
> void chromAnnFree(struct chromAnn **caPtr)
> /* free an object */
> {
> struct chromAnn *ca =3D *caPtr;
> if (ca !=3D NULL)
> =A0=A0 =A0{
> =A0=A0 =A0ca->recFree(ca);
> =A0=A0 =A0freeMem(ca->chrom);
> =A0=A0 =A0freeMem(ca->name);
> =A0=A0 =A0chromAnnBlkFreeList(ca->blocks);
> =A0=A0 =A0freez(caPtr);
> =A0=A0 =A0}
> }
> int chromAnnTotalBlockSize(struct chromAnn* ca)
> /* count the total bases in the blocks of a chromAnn */
> {
> int bases =3D 0;
> struct chromAnnBlk *cab;
> for (cab =3D ca->blocks; cab !=3D NULL; cab =3D cab->next)
> =A0=A0 =A0bases +=3D (cab->end - cab->start);
> return bases;
> }
> static void strVectorWrite(struct chromAnn *ca, FILE *fh, char term)
> /* write a chromAnn that is represented as a vector of strings */
> {
> char **cols =3D ca->rec;
> assert(cols !=3D NULL);
> int i;
> for (i =3D 0; cols[i] !=3D NULL; i++)
> =A0=A0 =A0{
> =A0=A0 =A0if (i > 0)
> =A0=A0 =A0 =A0 =A0putc_unlocked('\t', fh);
> =A0=A0 =A0fputs(cols[i], fh);
> =A0=A0 =A0}
> putc_unlocked(term, fh);
> }
--
Dennis Gascoigne
0407 639 995
dennis DOT gascoigne AT gmail DOT com
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -