Thread overview | |||||
---|---|---|---|---|---|
|
February 27, 2003 Linker Errors | ||||
---|---|---|---|---|
| ||||
I'm having some linker errors that I can't seem to track down. My code is below. Let me know if you have any ideas. >>> The errors that I get from the linker are: xmlparser.obj(xmlparser) Error 42: Symbol Undefined __Class_XmlDocumentFactory xmlparser.obj(xmlparser) Error 42: Symbol Undefined _Dxmldocumentfactory_XmlDocumentFactory__ctor_FZC18XmlDocumentFactory >>> The shell script I'm using to compile my files is: DMD=\dmd\bin\dmd DFLAGS= $(DMD) xmlparser.d $(DFLAGS) xmlparser del xmlparser.obj xmlparser.exe >>> The xmlparser.d file contains this simple little main function: import xmldocumentfactory; void main (char[][] args) { XmlDocumentFactory xml = new XmlDocumentFactory(); } >>> And, the xmldocumentfactory.d file contains this class: import string; import regexp; import c.stdio; class XmlDocumentFactory { private char[][] lex; private char[] inputString = "<node1><node2></node2></node1>"; this() { lex = splitStringByBracketGroups(inputString); for (int i = 0; i < lex.length; i++) { printf(lex[i][] ~ "\n"); } } private char[][] splitStringByBracketGroups(char[] source) { // RegExp switches g & m are used for global & multiline matches RegExp bracketSplit = new RegExp("[<>]","gm"); return bracketSplit.split(source); } } >>> Any help? |
February 27, 2003 Re: Linker Errors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Benji Smith | dmd does not search for obj (as javac does for class and java files when compiling). you need to do dmd xmlparser.d xmldocumentfactory.d or dmd -c xmlparser.d dmd -c xmldocumentfactory.d dmd xmlparser.obj xmldocumentfactory.obj or dmd -c xmldocumentfactory.d dmd xmlparser.d xmldocumentfactory.obj or ..... make a .lib with the xml doc factory etc or use link not dmd to link or (I'm sure you get the picture). "Benji Smith" <Benji_member@pathlink.com> wrote in message news:b3m0hv$1os1$1@digitaldaemon.com... > I'm having some linker errors that I can't seem to track down. My code is below. > Let me know if you have any ideas. > > >>> The errors that I get from the linker are: > > xmlparser.obj(xmlparser) > Error 42: Symbol Undefined __Class_XmlDocumentFactory > xmlparser.obj(xmlparser) > Error 42: Symbol Undefined > _Dxmldocumentfactory_XmlDocumentFactory__ctor_FZC18XmlDocumentFactory > > >>> The shell script I'm using to compile my files is: > > DMD=\dmd\bin\dmd > DFLAGS= > > $(DMD) xmlparser.d $(DFLAGS) > xmlparser > del xmlparser.obj xmlparser.exe > > >>> The xmlparser.d file contains this simple little main function: > > import xmldocumentfactory; > > void main (char[][] args) { > XmlDocumentFactory xml = new XmlDocumentFactory(); > } > > >>> And, the xmldocumentfactory.d file contains this class: > > import string; > import regexp; > import c.stdio; > > class XmlDocumentFactory { > > private char[][] lex; > private char[] inputString = "<node1><node2></node2></node1>"; > > this() { > lex = splitStringByBracketGroups(inputString); > for (int i = 0; i < lex.length; i++) { > printf(lex[i][] ~ "\n"); > } > } > > private char[][] splitStringByBracketGroups(char[] source) { > // RegExp switches g & m are used for global & multiline matches > RegExp bracketSplit = new RegExp("[<>]","gm"); > return bracketSplit.split(source); > } > } > > >>> Any help? > > |
Copyright © 1999-2021 by the D Language Foundation