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 &lt;stdio.h&gt;<br>#include &quot;gdal.h&quot;<br><br>int main() {<br><br>
&nbsp;&nbsp;&nbsp; printf(&quot;test\n&quot;);<br><br>&nbsp;&nbsp;&nbsp; GDALAllRegister();<br><br>}<br clear="all"><br><br>but get:<br><br>/tmp/cc4QzAsI.o: In function `main&#39;:<br>helloworld.c:(.text+0x1e): undefined reference to `GDALAllRegister&#39;<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