[jdev] Any quick/ simple c/c++ libraries/tutorials?

Jack Moffitt jack at chesspark.com
Sun Nov 2 06:58:23 CST 2008


> so my libstrophe copy is still looking for headers like :
>
> #include <urlmon.h>
> #include <tchar.h>

I told you once already that you don't need to compile every file in
expat.  libstrophe only uses xmlparse.c, xmltok.c, and xmlrole.c.
None of these files use either of these two headers.

Here is the relevant   from SConstruct on how to build the things in
the expat subdirectory:

ExpatSources = Split("""
  xmlparse.c
  xmltok.c
  xmlrole.c
""")

and

expatenv = env.Clone()
# feature defs
expatenv.Append(CCFLAGS=" -DXML_DTD")
expatenv.Append(CCFLAGS=" -DXML_NS")
expatenv.Append(CCFLAGS=" -DXML_CONTEXT_BYTES=1024")
# sys config defs (these should be autodetected)
expatenv.Append(CCFLAGS=" -DBYTEORDER=4321")
expatenv.Append(CCFLAGS=" -DHAVE_MEMMOVE")
expatenv.Append(CCFLAGS=" -DHAVE_UNISTD")


With gcc this amounts to compiling three files with those listed
defines, then turning them into a library.  Under linux this would be
an 'expat.a', and under windows this would be 'expat.lib'.

To build the libstrophe part you need to compile these:

Sources = Split("""
  ctx.c
  conn.c
  parser.c
  handler.c
  auth.c
  event.c
  stanza.c
  jid.c
  sock.c
  hash.c
  sasl.c
  sha1.c
  md5.c
  util.c
  thread.c
  snprintf.c
  tls_schannel.c
""")

They need the compiler define XML_STATIC and to be linked to expat.lib.

Hopefully this will help.

jack.



More information about the JDev mailing list