How to compile C version of vtd-xml under linux (32 bit)

192 Views Asked by At

I've downloaded ximpleware_2.11_c.zip (C version of vtd-xml), when I have tried to compile it under linux I've the following error messages:

In file included from vtdNav.c:19:
vtdNav.h:82: error: expected declaration specifiers or ‘...’ before ‘FILE’
vtdNav.h:506: error: expected declaration specifiers or ‘...’ before ‘FILE’
vtdNav.h: In function ‘writeIndex_VTDNav’:

vtdNav.c: At top level:
vtdNav.c:3410: error: conflicting types for ‘writeIndex_VTDNav’
vtdNav.h:347: error: previous declaration of ‘writeIndex_VTDNav’ was here
vtdNav.c: In function ‘dumpXML’:
vtdNav.c:3554: error: too many arguments to function ‘dumpXML2’
vtdNav.c: At top level:
vtdNav.c:3562: error: conflicting types for ‘dumpXML2’
vtdNav.h:362: error: previous declaration of ‘dumpXML2’ was here 
In file included from vtdNav.c:19:
vtdNav.h:82: error: expected declaration specifiers or ‘...’ before ‘FILE’
vtdNav.h:506: error: expected declaration specifiers or ‘...’ before ‘FILE’
vtdNav.h: In function ‘writeIndex_VTDNav’:
vtdNav.h:507: error: ‘f’ undeclared (first use in this function)
vtdNav.h:507: error: (Each undeclared identifier is reported only once
vtdNav.h:507: error: for each function it appears in.)
vtdNav.h:507: error: too many arguments to function 
‘vn->__writeIndex_VTDNav’

vtdNav.h: At top level: 
vtdNav.h:675: error: expected declaration specifiers or ‘...’ before ‘FILE’
vtdNav.h:695: error: expected declaration specifiers or ‘...’ before ‘FILE’

vtdNav.c: In function ‘_writeIndex2_VTDNav’:
vtdNav.c:3751: error: too many arguments to function ‘writeIndex_VTDNav’
vtdNav.c: In function ‘dumpXML’:
vtdNav.c:3874: error: too many arguments to function ‘dumpXML2’
vtdNav.c: At top level:
vtdNav.c:3882: error: conflicting types for ‘dumpXML2’
vtdNav.h:695: error: previous declaration of ‘dumpXML2’ was here

make: *** [vtdNav.o] Error 1

How can I build it under linux ?

Thanks for your response.

2

There are 2 best solutions below

1
On

I've put

#include <stdio.h> 

in :

vtdNav.h and in transcoder.h

and now it compile.

0
On

I'm sorry to have put a post to ask how to compile the examples. I have compiled them by modifying the makefile already present in ximpleware_2.11_c and in this way works:

CC=gcc

CFLAGS= -c -O3 -Wall -Winline -fgnu89-inline -fomit-frame-pointer-fforce-addr -frerun-cse-after-loop -fexpensive-optimizations -fregmove -frerun-loop-opt -fmerge-all-constants -fno-branch-count-reg -funroll-loops -fpeephole -march=core2-falign-functions -falign-loops -falign-jumps -freorder-blocks -freorder-functions-fprefetch-loop-arrays -funswitch-loops -fbranch-target-load-optimize2 -fvpt --paraminline-unit-growth=300 --param max-inline-recursive-depth=2 --param large-function-growth=600

CFLAGS2 = -c -ggdb
LDFLAGS = -O3 -fomit-frame-pointer -fforce-addr -frerun-cse-after-loop-fexpensive-optimizations -fregmove -frerun-loop-opt -march=core2 -lm
LDFLAGS2  = -ggdb

all :  hello_world



hello_world: hello_world.o ../../arrayList.o ../../fastIntBuffer.o ../../fastLongBuffer.o ../../contextBuffer.o ../../vtdNav.o ../../vtdGen.o ../../autoPilot.o ../../XMLChar.o ../../helper.o ../../lex.yy.o ../../l8.tab.o ../../literalExpr.o ../../numberExpr.o ../../pathExpr.o ../../filterExpr.o ../../binaryExpr.o ../../unaryExpr.o ../../funcExpr.o ../../locationPathExpr.o ../../intHash.o ../../unionExpr.o ../../decoder.o ../../XMLModifier.o ../../nodeRecorder.o ../../indexHandler.o ../../bookMark.o ../../elementFragmentNs.o ../../transcoder.o ../../textIter.o ../../variableExpr.o ../../cachedExpr.o



clean:
       -rm *.o


hello_world.o : hello_world.c
        ${CC} ${CFLAGS} hello_world.c