Thanks a lot for your help guys. I've been since using Matlab for a while now, and the entire compilations and linking stuff doesn't make sense to me anymore. I went into project and added all the files necessary to the project. It works, except one last part in linking. This is the error I get.
--------------------Configuration: mc_main - Win32 Debug--------------------
Linking...
main.obj : error LNK2001: unresolved external symbol _dist
Debug/main.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
main.exe - 2 error(s), 0 warning(s)
Now, dist is an inline function included in another file (utilities.c), which doesn't have a header file. Does the linker look for it, or am I supposed to somehow tell it its there?
Code:
inline double dist(double x1, double y1, double z1,
double x2, double y2, double z2)
{
double d;
d=sqrt(DSQR(x1-x2)+DSQR(y1-y2)+DSQR(z1-z2));
return(d);
}