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

Hamish hamish_b at yahoo.com
Sun Sep 14 07:42:07 EDT 2008


Glynn Clements wrote:
> 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.

Ok, making 'int line;' local to both mark.c and use_camera.c gets it to
compile again.

One thing though- doing so ensures that line will be used uninitialized
in the if() on L242 of mark.c (because pager==0):
http://trac.osgeo.org/grass/browser/grass/trunk/imagery/i.ortho.photo/photo.2image/mark.c#L224

it would be set to 0 on L239 but for some reason has been commented out
pre-CVS. Move the line=0; to the beginning of the outer while loop?
(next to pager=0)

Does anyone know if the Spearfish Imagery demo dataset includes
i.ortho.photo tutorial camera files for testing?
  http://grass.osgeo.org/download/data6.php


Hamish



      



More information about the grass-user mailing list