Using GEOS.... there is other option:

GEOSCoordSequence* seq = GEOSCoordSeq_create(unsigned int size, unsigned int dims);
...

GEOSGeometry * g = GEOSGeom_createLinearRing(GEOSCoordSequence* s);
char * wkb = GEOSGeomToWKT(const GEOSGeometry* g);

Do you agree ?