Still working on MB-System
Yeah, I really should’ve realized it was just too easy. I just tried installing MB-System, and I am getting a ton of errors because my c compiler is not recognizing simple math functions like sin, cos, sqrt, pow, etc. I’m sure this is a really simple issue, and I’m just clueless about c in general. But I really don’t know how to fix this.
Googling around, I did find some information – I think I’m missing a ‘-lm’ option somewhere (so that c links to the math library). I found this conversation on an Ubuntu forum. Someone else was having the same problem, and part of the troubleshooting involved created a simple test program in C that uses some a math function (sin in this case). Here’s the little script that they use to create the test program. It’s called ‘test1.c’.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
main()
{
float x,y;
printf("enter the value of x\n");
scanf("%f",&x);
printf("Hello world\n");
y=sin(x);
printf("value of y is %f \n",y);
printf("\nEnd of program\n");
}
Then if I type gcc -o test1 -lm test1.c in the terminal window, it creates a compliled program test1 from the test1.c code. I was then able to run it by type ./test1. Now, this didn’t exactly solve my problem, but it was pretty cool, and it worked. Which is significant in its own right since it is, quite literally, my VERY FIRST C PROGRAM. Ever. Yup, I just skipped right over “Hello, world”.
So, eventually I did manage to get past the above problem. I had a typo in my install_makefiles script, so I had to re-run it:
./install_makefiles
then sudo make all.
I was then able to find and use the appropriate math library. But I was still getting a ton of ‘undefined reference’ errors for a bunch of GDAL files. Not sure how to fix that. I think it’ll have to wait until tomorrow…

