[Proj] Help with multiply defined globals in Proj4 - Mac

bsupnik bsupnik at xsquawkbox.net
Thu Jun 24 21:41:26 EDT 2004


Hi Y'all,

First of all, thanks Gerald Evenden, Niles Ritter and Frank Warmerdam 
for libGeoTiff and Proj4...I'm working on decoding Geotiff images and 
their coordiantes and they're a life saver, especially for UTM->geo 
conversion.

Anyway, here's my compile issue...since I'm working in a Mac IDE I'm not 
using the unix makefiles, which may be how I got into trouble:

geodesic.h defines a few global variables:

n_alpha, n_S;
	double
to_meter, fr_meter, del_alpha;


And is then included in multiple translation units.  Since they are not 
externed and not initialized, my compiler can't tell which declaration 
is the master one, and I am getting a duplicate definition link error.

What is the correct way to solve this?  Should I have all of the 
translation units (geod_for.c, geod_inv.c, geod_set.c) or do I only need 
some of them?  Should I simply declare them extern?

Thanks!
Ben




More information about the Proj mailing list