Compiling Expat XML parser under Series 60...

Login to reply to this topic.
Mon, 2003-10-27 12:11
Joined: 2003-10-27
Forum posts: 7
Hi,

Has anyone sucessfully compiled the Expat XML parser under Series 60? I have been trying to do sao and am getting a load of errors.. at first some unresolved external symbols.. and now tons of undefined refrences & relocation trunculated... ending with Error 1.

What are the steps involed (other than creating the bld & mmp files) to compile the above under Symbian.. should one compile XmlParse, XmlToken, XmlWf seperately and/or in any particular order? Xmlparse seems to compile straight away under MS Windows using the DSP files supplied with Expat.

Any clues???
Ta,
Ash

Ash


Mon, 2003-10-27 12:50
Joined: 2003-05-27
Forum posts: 363
Compiling Expat XML parser under Series 60...
Hi,

This would be a good topic for a tutorial because many people ask about compiling Expat for Symbian.

I am looking into this in the near future - if you manage to come up with a description of your problems and solutions before that, please post them here  Smiley .

Cheers,
Pawel
Mon, 2003-10-27 12:59
Joined: 2003-10-27
Forum posts: 7
Compiling Expat XML parser under Series 60...
Hmm.. I agree, I was thinking on the same lines, if I get the darn thing working, I would like to share it with others, as Symbian does need an XML parser.

Cheers!
Ash

Ash

Mon, 2003-10-27 14:41
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2009
Compiling Expat XML parser under Series 60...
That would be great.
BTW, did you check Simkin scripting language. I think that Simon has posted somewhere on the site that it includes Expat.

Cheers,
Eric

Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Mon, 2003-10-27 14:44
Anonymous (not verified)
Forum posts: 2043
Compiling Expat XML parser under Series 60...
Matter of fact, just going throught the SimKin code... seems an over kill... I just need a basic XML parser for my project.

Ash
Mon, 2003-10-27 15:27
Joined: 2003-10-27
Forum posts: 7
Re: Compiling Expat XML parser under Series 60...
Getting the below error message...

XMLPARSE.obj : error LNK2001: unresolved external symbol _XmlGetUtf8InternalEncoding
XMLPARSE.obj : error LNK2001: unresolved external symbol _XmlInitEncoding
XMLPARSE.obj : error LNK2001: unresolved external symbol _XmlPrologStateInit
XMLPARSE.obj : error LNK2001: unresolved external symbol _XmlUtf8Encode
XMLPARSE.obj : error LNK2001: unresolved external symbol _XmlParseXmlDecl
XMLPARSE.obj : error LNK2001: unresolved external symbol _XmlInitUnknownEncoding
XMLPARSE.obj : error LNK2001: unresolved external symbol _XmlSizeOfUnknownEncoding
EDLL.LIB(UP_DLL.obj) : error LNK2001: unresolved external symbol "int __cdecl E32Dll(enum TDllReason)" (?E32Dll@@YAHW4TDllReason@@@Z)
\Symbian\6.1\Series60\EPOC32\BUILD\XML\EXPAT\XMLPARSE\XMLPARSE\WINS\UDEB\XMLPARSE.DLL : fatal error LNK1120: 8 unresolved externals
NMAKE : fatal error U1077: 'link.exe' : return code '0x460'
Stop.

Ash

Mon, 2003-10-27 16:05
Joined: 2003-05-27
Forum posts: 363
Compiling Expat XML parser under Series 60...
Hi,

I managed to almost compile it with the following files:

XMLPARSE.MMP:

Code:
TARGET        xmlparse.dll
TARGETTYPE    dll
UID           0x1000008d 0x100aeeef

MACRO XML_MIN_SIZE

SOURCEPATH    .\xmlparse
SOURCE        xmlparse.c

SOURCEPATH .
SOURCE dllm.cpp

SOURCEPATH    .\xmltok
SOURCE        xmlrole.c
SOURCE        xmltok.c

USERINCLUDE   .\xmlparse
USERINCLUDE   .\xmltok

SYSTEMINCLUDE ..\..\..\..\..\..\symbian\series60_cw\epoc32\include\libc
SYSTEMINCLUDE \Epoc32\include

LIBRARY       euser.lib estlib.lib

#if defined(WINS)
   deffile .\xmlparseWINS.def
#else if defined(ARM)
   deffile .\xmlparseARM.def
#endif
nostrictdef

DLLM.CPP:

Code:
#include <e32base.h>
#include <e32def.h>
#include <e32uid.h>

// The E32Dll() entry point function
GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
{
return(KErrNone);
}

The only problem is with the global variables so this does not directly compile into a DLL. But then this is a standard problem which is discussed elsewhere..

Cheers,
Pawel
Mon, 2003-10-27 17:26
Joined: 2003-05-27
Forum posts: 363
Compiling Expat XML parser under Series 60...
Simkin comes with a functional expat DLL for Symbian - I guess there is a compile-time flag to get rid of static variables. That should solve the problem?

Cheers,
Pawel
Tue, 2003-11-25 07:50
Joined: 2003-11-25
Forum posts: 6
Compiling Expat XML parser under Series 60...
i think i have managed to compile expat for symbian

- first, i used pawel's .mmp and .cpp files
- i placed all the necessary files in one folder,  mostly files from expat/lib. so no group, src, etc folders
- change #include <expat_config.h> to #include "expat_config.h" on some .c files
- do a 'abld build freeze'
- then compile, no errors

now my question is, how to use the DLL

#include .sig

Tue, 2003-11-25 18:40
Anonymous (not verified)
Forum posts: 2043
Compiling Expat XML parser under Series 60...
Hi,

Smiley What about sexy class RLibrary ? especially Load() and Lookup() methods.

CIAO
Mon, 2003-12-15 15:32
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2009
Compiling Expat XML parser under Series 60...
Here is the MMP file I use for compiling the expat version found on Simkin site (using Visual Studio / Nokia NS60 1.2 SDK):

Code:
TARGET Expat.dll
TARGETTYPE dll
UID 0x1000008D 0x101FAE0C

MACRO __SYMBIAN32__

SOURCEPATH ..\lib
SOURCE ..\lib\xmlparse.c
SOURCE ..\lib\xmlrole.c
SOURCE ..\lib\xmltok.c
SOURCE ..\symbian\expatdll.cpp

USERINCLUDE .
USERINCLUDE ..\lib

SYSTEMINCLUDE  \epoc32\include
SYSTEMINCLUDE ..\lib
SYSTEMINCLUDE .
SYSTEMINCLUDE  \epoc32\include\libc

LIBRARY estlib.lib euser.lib edll.lib
#if defined(WINS)
deffile .\Expat_wins.def
#else
#if defined(ARM)
deffile .\Expat_armi.def
#endif
#endif
nostrictdef

Just replace the content of the MMP files found in the zip by this content.
The expaf.dll / lib files can then be created for WINS / ARMI / THUMB target from command line. Compilation will fail from VC6.

Eric
Code:

Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Tue, 2004-01-06 13:20
Anonymous (not verified)
Forum posts: 2043
Compiling Expat XML parser under Series 60...
got the soufce (expat 1.95.5). unpacked it and used Eric's MMP. However i get a problem with devices which says that perl isnt supported for this platform.

I am using S60 v1.2.

Any ideas what could be causing this ?

thanks
Tue, 2004-01-06 13:38
Anonymous (not verified)
Forum posts: 2043
Compiling Expat XML parser under Series 60...
problem solved. you need to set EPOCROOT and the paths up correctly
Fri, 2004-01-23 11:46
Ashy (not verified)
Forum posts: 2043
Expat - can't use dll under ARMI build
hi,

did the expat port, and used the dll within another porgram to parse an xml file, ad it works fine under the emulator, but doesn't compile for the ARMI build as the parser uses static variables...

anyone got to get it working/usable under the ARMI build???

Ta,
Ash
Fri, 2004-01-23 14:47
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2009
Compiling Expat XML parser under Series 60...
I have got no problem for THUMB compilation (using the MMP file I already post and the SIMKIN archive slightly tweaked to offer a descriptor based API).

No thoroughly tested on mobile so far so I cannot guarantee there is no problem however

Eric

Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

  • Login to reply to this topic.