<div dir="ltr"><div>Hi,</div><div><br></div><div>i.landsat.toar compilation fails when compiling using clang compiler. The error is:</div><div><br></div><div> undefined reference to `date_replace_slash'<br></div><div><br>


</div><div>This function is defined using ``inline`` keyword:</div><div><br></div><div> inline void date_replace_slash(char *str)<br></div><div><br></div><div>I know ``inline`` is not part of C89. However, I'm not sure about the fix. I can fix it by replacing ``inline`` by ``__inline__``. This works for GCC [1] and clang (should support GCC extensions) but I'm not sure about other compilers (on the less usual platforms). </div>


<div><br></div><div>Moreover, I actually don't know how what causes the error in the first place.</div><div><br></div><div>Alternative fixes are macro but I would just do the normal function and hope for compiler optimization.</div>


<div><br></div><div>Note that the function should be probably static.</div><div><br></div><div>Vaclav</div><div><br></div><div>[1] <a href="http://gcc.gnu.org/onlinedocs/gcc/Inline.html" target="_blank">http://gcc.gnu.org/onlinedocs/gcc/Inline.html</a></div>


<div><br></div><div><br></div><div>Log:</div><div>: && clang -L.../dist.i686-pc-linux-gnu/lib -L.../dist.i686-pc-linux-gnu/lib -Wl,--export-dynamic -Wl,-rpath-link,.../dist.i686-pc-linux-gnu/lib  -o .../dist.i686-pc-linux-gnu/bin/i.landsat.toar OBJ.i686-pc-linux-gnu/earth_sun.o OBJ.i686-pc-linux-gnu/landsat.o OBJ.i686-pc-linux-gnu/landsat_met.o OBJ.i686-pc-linux-gnu/landsat_set.o OBJ.i686-pc-linux-gnu/main.o    -lgrass_raster.7.0.svn -lgrass_gis.7.0.svn  -lm </div>


<div>OBJ.i686-pc-linux-gnu/landsat_met.o: In function `lsat_metadata':</div><div>.../imagery/i.landsat.toar/landsat_met.c:124: undefined reference to `date_replace_slash'</div><div>.../imagery/i.landsat.toar/landsat_met.c:138: undefined reference to `date_replace_slash'</div>


<div>clang: error: linker command failed with exit code 1 (use -v to see invocation)</div></div>