I installed GDAL by installing FWTools (I currently have it under /opt) <br>Using Ubuntu 7.10<br>For some reason I try to compile :<br><br>#include <stdio.h><br>#include "gdal.h"<br><br>int main() {<br><br>
printf("test\n");<br><br> GDALAllRegister();<br><br>}<br clear="all"><br><br>but get:<br><br>/tmp/cc4QzAsI.o: In function `main':<br>helloworld.c:(.text+0x1e): undefined reference to `GDALAllRegister'<br>
collect2: ld returned 1 exit status<br><br><br>the compile command I use is: <br><br>gcc -I/opt/FWTools/FWTools2.4.0/include/ helloworld.c<br><br>where the include/ subfolder contains all the header files: gdal.h.... ecc ecc<br>
<br><br>Have done it as super user and the same result was coming put when I have gdal installed as from synaptic packet manager (which I now tried removing)<br><br>Does anyone know where the problem might me?<br>Is it the compiler? should I be using another instead of gcc.. <br>
<br>I tried following the tutorial and this is where the C snippet have pasted comes from ..<br>I deduce that I actually can write C code to use the GDAL API!!! <br>But then again , why doesnt it compile?? <br><br>thanks for u time<br>
<br>-- <br>Mati