using pieces of mapserver code

Michael Hearne mhearne at bellsouth.net
Sun Jan 28 12:11:16 EST 2001


This is almost a C programming question, but I don't know of any groups
to which I could address the question other than this one.  Here goes:

I am a so-so C programmer, who has never really undertaken any large C
programming projects.  I understand C syntax (for the most part), but I
get confused when I have to include multiple source files, particularly
those written by other people.  I'm trying to get started in
understanding how some of the various useful functions in the mapserver
source code work.

For example, I'm trying to compile the code included at the bottom of
this message, and I keep getting 'undefined reference to X' messages. 
In Java (for example), if you want to use one method from a particular
class, you just import that class, and the compiler grabs all of the
classes that class depends on, and so forth.  I think it's not exactly
that, but the point is from the programmer's standpoint it is easy.  

Is there a utility for C that allows you to build the appropriate
makefiles without chasing down all of the necessary functions in all of
the source code?

Or, could I use (or make) a library out of the C code that is in
mapserver and use that?


Thanks!
-Mike Hearne

------source code below
#include "map.h"
#include "mapparser.h"
#include <string.h>

int main(int argc, char *argv[]){
	shapefileObj shpfile;
	char path[320] = "/home/httpd/html/mapserv/ms_demo/data/";
	char * tile = NULL;
	char filename[80] = "will_sav";
	
	printf("Your path is %s\n",path);
	printf("Your filename is %s\n",filename);

	if(msOpenSHPFile(&shpfile, "rb", path, tile, filename) == -1){
		printf("Filename %s cannot be opened!\n",filename);
	}
}



More information about the mapserver-users mailing list