[GRASS-user] Linking error in photo.2image

Glynn Clements glynn at gclements.plus.com
Sun Sep 14 04:02:32 EDT 2008


Hamish wrote:

> Getting back to the actual error message, maybe the "line" variable
> set in imagery/i.ortho.photo/photo.2image/camera_ref.h is conflicting
> between the "line" variable used in marc.c and the one in use_camera.c?

No. The end result of the preprocessor abuse is that the variable is
defined as "int line" in use_camera.c and declared as "extern int line"
in mark.c. Both files are compiled with exactly the same switches.

If there was a problem with that, you would have the same problem with
all of the other variables declared/defined in camera_ref.h.

It's more likely that some other file also contains a symbol named
"line". But the only one which I can find is the line() function in
lib/driver/Polygon.c, and that isn't exported.

In any case, we can probably eliminate that specific issue by making
"line" a local variable in both _drawcam() (in mark.c) and drawcamnew()
(in use_camera.c). In each case, the variable is actually specific to a
while loop; there's no actual reason for it to be a global variable.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list