2014-01-07 2 views
1

ximpleware_2.11_c.zip (C 버전의 vtd-xml)을 다운로드했습니다. 을 Linux에서 컴파일하려고 시도했습니다. 다음과 같은 오류 메시지가 표시됩니다.linux (32 비트)에서 vtd-xml의 C 버전을 컴파일하는 방법

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 

어떻게하면 Linux에서 만들 수 있습니까?

답장을 보내 주셔서 감사합니다.

+0

잘 모르겠습니다. 64 비트 우분투에서 컴파일하지 않습니다. –

+0

이것은 특정 버전의 문제인 것으로 보입니다. 우리는 우분투 64에서 컴파일하고 잘 작동합니다 ... gmake 버전은 3.81, gcc 4.4.1입니다. –

+0

@ vtd-xml-author 제 버전은 다음과 같습니다 : LSB 버전 : core-3.1 -ia32 : 코어 - 3.1 noarch : 그래픽 3.1 IA32 : 그래픽 3.1 noarch 배포자 ID : ScientificSL 설명 : 5.2 코드 명 : 과학적 리눅스 SL 5.2 (붕소) 릴리스 해제 붕소를 D – famedoro

답변

1

난에

#include <stdio.h> 

을 넣어했습니다

vtdNav.h 및 transcoder.h

에 지금은 컴파일합니다.

+0

이제 또 다른 문제가 있습니다. 어떻게 c_tutorial_by_code_examples_2.11.zip에서 예제를 컴파일 할 수 있습니까? 폴더 ximpleware_2.11_c/vtd-xml/(fullpath는 ximpleware_2.11_c/vtd-xml/c_tutorial_by_code_examples_2.11)에 c_tutorial_by_code_examples_2.11 폴더를 넣었고 예제 1을 컴파일하려고 시도했습니다. gcc -o hello_world.c -lm이 오류가있는 : /tmp/ccM50xiu.o : in function main ': hello_world.c :(. 텍스트 + 0x55) : 정의되지 않은 참조 tocreateVTDGen'hello_world.c :(. 텍스트 + 0x73) : 정의되지 않음 parseFile 'hello_world.c : 1 개의 종료 상태를 반환했습니다. – famedoro

1

예제를 컴파일하는 방법을 묻는 게시글을 작성해 드려 죄송합니다. ximpleware_2.11_c에 이미있는 makefile을 수정하여이 파일들을 컴파일하고 다음과 같이 작동합니다.

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 
관련 문제