1

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.

famedoro
  • 1,223
  • 2
  • 17
  • 41
  • I'm not sure. Doesn't compile on 64-bit ubuntu either. – Elliott Frisch Jan 07 '14 at 15:53
  • this appears to be a version specific issue, we compile it on ubuntu 64 and it works fine... gmake version is 3.81, gcc 4.4.1 – vtd-xml-author Jan 10 '14 at 07:42
  • @vtd-xml-author my version are: LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: ScientificSL Description: Scientific Linux SL release 5.2 (Boron) Release: 5.2 Codename: Boron d – famedoro Jan 16 '14 at 13:01
  • @vtd-xml-author gcc -v Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux Thread model: posix gcc version 4.1.2 20080704 (Red Hat 4.1.2-50) – famedoro Jan 16 '14 at 13:08
  • @vtd-xml-author gmake -v GNU Make 3.81 This program built for i686-redhat-linux-gnu Should I use some particular option at compile time ? – famedoro Jan 16 '14 at 13:19
  • @vtd-xml-author You're right ! I've tried on gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) and it works, how can I compile even on gcc version 4.1.2 20080704 (Red Hat 4.1.2-50) ? – famedoro Jan 16 '14 at 13:51

2 Answers2

1

I've put

#include <stdio.h> 

in :

vtdNav.h and in transcoder.h

and now it compile.

famedoro
  • 1,223
  • 2
  • 17
  • 41
  • Now I've another problem: how can I compile the examples in c_tutorial_by_code_examples_2.11.zip. I've put the folder c_tutorial_by_code_examples_2.11 under the folder ximpleware_2.11_c/vtd-xml/ (fullpath is ximpleware_2.11_c/vtd-xml/c_tutorial_by_code_examples_2.11) and I've tried to compile example 1 using gcc -o hello_world hello_world.c -lm with this error: /tmp/ccM50xiu.o: In function main': hello_world.c:(.text+0x55): undefined reference tocreateVTDGen' hello_world.c:(.text+0x73): undefined reference to parseFile' hello_world.c:returned 1 exit status – famedoro Jan 17 '14 at 13:21
1

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
famedoro
  • 1,223
  • 2
  • 17
  • 41