-
XML library
hi, i have downloaded xml library from xmlsoft.org, the library name is libxml2 (for linux, windows) .... i read the doc but it is not very clear .... i don't understand if with this library is possible to create xml files or it's only possible to parse xml file...
thank u
bye
:)
-
this is a simple apllication that it should create an xml file....if i understand api specification....
but with borland 5.5 compiler i have an error with linker...
-------------------------------------------------
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
int main()
{
xmlDocPtr docPtr;
xmlNodePtr nodePtr;
xmlChar *name;
xmlChar *content;
docPtr = xmlNewDoc("1.0");
name = "tag";
content = "mmm";
nodePtr = xmlNewDocNode(NULL, NULL, name, content);
return 0;
}
-
these is the errors:
Error: Unresolved external '_xmlNewDoc' referenced from D:\UNI\PROGETTONE\XML\TEST.OBJ
Error: Unresolved external '_xmlNewDocNode' referenced from D:\UNI\PROGETTONE\XML\TEST.OBJ
please help me :)
-
but i already put the library in the path ( \include) the problem is that the linker doesn't find the reference....
don't u think??
-
of course u are right....
i'm a little bit stupid :rolleyes:
but if i compile with option
-L library there is another error :confused:
D:\uni\Progettone\XML>bcc32 -L "c:\Program Files\borland\compiler\lib\libxml2.lib" test.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
test.c:
Warning W8004 test.c 25: 'nodePtr' is assigned a value that is never used in function main
Warning W8004 test.c 25: 'docPtr' is assigned a value that is never used in function main
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: 'C:\PROGRAM FILES\BORLAND\COMPILER\LIB\LIBXML2.LIB' contains invalid OMF record, type 0x21 (possibly COFF)
what's wrong????
-
-
i tried but there is already the same problem.......
-
i resolved the problem with COFF2OMF borland tool ......the compile goes all ok.
now i have to understand how to use tihs libraries :)
i execute the program compiled above but it doesn't create an xml file, it creates two file:
1) tree.obj
2) tree.tds
wich type of file are these??
-
i know but i don't know where are these functions....
thank u however :)
-
>>Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: 'C:\PROGRAM FILES\BORLAND\COMPILER\LIB\LIBXML2.LIB' contains invalid OMF record, type 0x21 (possibly COFF)
<<
In your Borland bin directory you should find COFF2OMF.EXE
Code:
COFF to OMF Converter Version 1.0.0.74 Copyright (c) 1999, 2000 Inprise Corporation
Syntax: COFF2OMF [options] InputFile OutputFile
-h, -? Display help
-q Quiet mode
-v Verbose mode
-r Remove (delete) output file if empty
-lib:xx Specify options for OMF import library generation:
ms - Allow entries that have MS C++ name mangling (default: no)
st - Normalize names instead of aliasing MS stdcall mangling
ca - Don't perform MS cdecl aliasing (default is to alias)
COFF2OMF will convert a COFF import library file (InputFile)
to the corresponding OMF type import library file (OutputFile).
If you don't know how to use it, try google'ing it.