www.digitalmars.com         C & C++   DMDScript  

D - Symbol Errors in Linker

Hello all,

I've tried to wrap expat.h and used it in outline.d and got the following, 
including an unexpected termination in OPTLINK.  Thoughts?



digc ./src/outline.d -lib=./lib/libexpat.lib -exe=./bin/outline
Searching source for imports.
Expanding import libraries... d:\dmd\bin\..\..\dm\bin\link.exe 
outline,./bin/outline.exe,,user32+kernel32/RC:digc_manifest.res/noi;

OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

OPTLINK : Warning 9: Unknown Option : OUTLINE.EXE
d:\dm\bin\..\lib\SNN.lib(excptlst)
  Error 1: Previous Definition Different : _end
outline.obj(outline)
  Error 42: Symbol Undefined _XML_GetErrorCode
outline.obj(outline)
  Error 42: Symbol Undefined _XML_ErrorString
outline.obj(outline)
  Error 42: Symbol Undefined _XML_GetCurrentLineNumber
outline.obj(outline)
  Error 42: Symbol Undefined _XML_ParserCreate
outline.obj(outline)
  Error 42: Symbol Undefined _XML_SetElementHandler
outline.obj(outline)
  Error 42: Symbol Undefined _XML_Parse
--- errorlevel 1

d:\dmd\bin\dmd.exe -version=WindowsXP  ./bin/outline.exe .\src\outline.d 
-I\dmd\src digc_manifest.res -Idigc_temp


--- errorlevel 1




outline.d:



import c.stdio;
import src.expat;
import file;
import string;

const int BUFFSIZE = 8192;

int Depth;

extern (C) {
	void start(void *data, char *el, char **attr) {
		int i;

		for (i = 0; i < Depth; i++)
			printf("  ");

		printf("%.*s", el);

		for (i = 0; attr[i]; i += 2) {
			printf(" %.*s='%.*s'", attr[i], attr[i + 1]);
		}

		printf("\n");
		Depth++;
	}  /* End of start handler */
}

extern (C) {
	void end(void *data, char *el) {
	  Depth--;
	}  /* End of end handler */
}

int main() {

	char[] fInput;
	char[][] inlines;
	char* buf;
	int i;
	int len;
	int done;

  	// open the input file
	fInput = cast(char[])file.read("mcs.xml");
	
	// split into lines based on CR
	inlines=splitlines(fInput);

	XML_Parser p = XML_ParserCreate(null);
	if (! p) {
		printf("Couldn't allocate memory for parser\n");
		exit(-1);
	}

	XML_SetElementHandler(p, start, end);

	for (i = 0; i < inlines.length; i++) {

		buf=string.toStringz(inlines[i][]);
		len=inlines[i][].length;
		done=0;
		
		if (! XML_Parse(p, buf, len, done)) {
			printf("Parse error at line %d:\n%.*s\n",
			XML_GetCurrentLineNumber(p),
			XML_ErrorString(XML_GetErrorCode(p)));
			exit(-1);
		}
	}
	return 0;
}  /* End of main */
Sep 19 2003