Opened 8 years ago

Closed 5 years ago

#762 closed defect (wontfix)

Compiling error on cygwin

Reported by: jingsam Owned by: geos-devel@…
Priority: major Milestone: 3.5.3
Component: Default Version: 3.5.0
Severity: Unassigned Keywords:
Cc:

Description

When I tried to compile geos on cygwin, errors occur:

geos_ts_c.cpp: in fucntion ‘void GEOSContextHandle_HS::NOTICE_MESSAGE(std::string, ...)’: geos_ts_c.cpp:228:81: error:‘vsnprintf’ undeclared in the context

int result = vsnprintf(msgBuffer, sizeof(msgBuffer) - 1, fmt.c_str(), args);

geos_ts_c.cpp: in function ‘void GEOSContextHandle_HS::ERROR_MESSAGE(std::string, ...)’中: geos_ts_c.cpp:249:81: error:‘vsnprintf’ undeclared in the context

int result = vsnprintf(msgBuffer, sizeof(msgBuffer) - 1, fmt.c_str(), args);

That may be caused by the non-existence of vsnprintf() which is a c++11 function.

g++ version: 4.9.3

Change History (5)

comment:1 by strk, 8 years ago

According to the man page:

snprintf(), vsnprintf():

_BSD_SOURCE
_XOPEN_SOURCE >= 500 _ISOC99_SOURCE _POSIX_C_SOURCE >= 200112L; or cc -std=c99

#include <stdio.h> #include <stdlib.h> #include <stdarg.h>

comment:2 by jingsam, 8 years ago

I got it. I checked the compiling command as fellows:

g++ -DHAVE_CONFIG_H -I. -I../include -I../include/geos -I../include -DGEOS_CAPI_VERSION=\"3.5.0-CAPI-1.9.0\" -DGEOS_JTS_PORT=\"1.13.0\" -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -ffloat-store -g -O2 -MT libgeos_c_la-geos_ts_c.lo -MD -MP -MF .deps/libgeos_c_la-geos_ts_c.Tpo -c geos_ts_c.cpp -DDLL_EXPORT -DPIC -o .libs/libgeos_c_la-geos_ts_c.o

The tag "-ansi" is equivalent to "-std=c++98". The function "vsnprintf()" is not implemented in ansi standard. I think GEOS should adjust the compiling command.

comment:3 by strk, 8 years ago

Milestone: 3.5.13.5.2

Ticket retargeted after milestone closed

comment:4 by robe, 6 years ago

Milestone: 3.5.23.5.3

comment:5 by pramsey, 5 years ago

Resolution: wontfix
Status: newclosed

Ancient version on ancient platform. Revive with a patch, it won't be worked on by the community.

Note: See TracTickets for help on using tickets.