| Ver tema anterior :: Ver siguiente tema |
| Autor | Mensaje |
|---|
janet20
Registrado: 03 Jul 2012 Mensajes: 3
| Publicado: 03/07/2012 12:14 pm | | | Título: Error con libxml2 |
| Hola nose porque a la hora de compilar un programa para leer un archivo xml me manda error, si ya instale, actualice libxml2-dev me sigue enviando error y ya he buscado informacion pero la mayoria dicen que hay que tener intalada la libreria y actualizada pero pues nada que sigue enviandome el siguiente error:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf make[1]: se ingresa al directorio `/home/serc/NetBeansProjects/archivo2' "/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/archivo2 make[2]: se ingresa al directorio `/home/serc/NetBeansProjects/archivo2' mkdir -p build/Debug/GNU-Linux-x86 rm -f build/Debug/GNU-Linux-x86/main.o.d gcc -c -g -I/usr/include/libxml2 -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.c mkdir -p dist/Debug/GNU-Linux-x86 gcc -o dist/Debug/GNU-Linux-x86/archivo2 build/Debug/GNU-Linux-x86/main.o make[2]: se sale del directorio `/home/serc/NetBeansProjects/archivo2' make[1]: se sale del directorio `/home/serc/NetBeansProjects/archivo2' build/Debug/GNU-Linux-x86/main.o: In function `processNode': /home/serc/NetBeansProjects/archivo2/main.c:9: undefined reference to `xmlTextReaderName' /home/serc/NetBeansProjects/archivo2/main.c:11: undefined reference to `xmlStrdup' /home/serc/NetBeansProjects/archivo2/main.c:12: undefined reference to `xmlTextReaderValue' /home/serc/NetBeansProjects/archivo2/main.c:14: undefined reference to `xmlTextReaderIsEmptyElement' /home/serc/NetBeansProjects/archivo2/main.c:14: undefined reference to `xmlTextReaderNodeType' /home/serc/NetBeansProjects/archivo2/main.c:14: undefined reference to `xmlTextReaderDepth' /home/serc/NetBeansProjects/archivo2/main.c:19: undefined reference to `xmlFree' /home/serc/NetBeansProjects/archivo2/main.c:24: undefined reference to `xmlFree' build/Debug/GNU-Linux-x86/main.o: In function `streamFile': /home/serc/NetBeansProjects/archivo2/main.c:34: undefined reference to `xmlNewTextReaderFilename' /home/serc/NetBeansProjects/archivo2/main.c:36: undefined reference to `xmlTextReaderRead' /home/serc/NetBeansProjects/archivo2/main.c:39: undefined reference to `xmlTextReaderRead' /home/serc/NetBeansProjects/archivo2/main.c:41: undefined reference to `xmlFreeTextReader' collect2: ld returned 1 exit status make[2]: *** [dist/Debug/GNU-Linux-x86/archivo2] Error 1 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2
gracias |
|
| Volver arriba | |
 |
rir3760

Registrado: 01 Oct 2004 Mensajes: 7517 Ubicación: Mexico
| Publicado: 05/07/2012 5:38 am | | | Título: |
| Hola janet20
Bienvenido a los foros. Por favor lee sus reglas.
Si, como indicas, tienes un problema con la instalación de una biblioteca por favor indica el IDE y SO que estas utilizando junto con cualquier otra información que pienses sea útil para solucionarlo.
Utilizas una distribución de Linux utilizando Net Beans, ¿Correcto?
Un saludo _________________ C retains the basic philosophy that programmers know what they are doing; it only requires that they state their intentions explicitly. -- Kernighan & Ritchie, The C programming language |
|
| Volver arriba | |
 |
janet20
Registrado: 03 Jul 2012 Mensajes: 3
| Publicado: 05/07/2012 6:18 am | | | Título: hola rir3760 |
| Gracias por contestar
Sii estoy utilizando Net Beans 6.9 y Linux version 2.6.32-5-amd64 (Debian 2.6.32-45) (dannf@debian.org) (gcc version 4.3.5 (Debian 4.3.5-4) ) .
Cualquier codigo que compile que tenga xml me envia errores similares : undefined reference to `xmlTextReaderRead'
Un saludo. |
|
| Volver arriba | |
 |
|
rir3760

Registrado: 01 Oct 2004 Mensajes: 7517 Ubicación: Mexico
| Publicado: 05/07/2012 7:03 am | | | Título: |
| OK. Muevo el tema al foro "Linux", esperemos en los próximos días alguien pueda ayudarte con el problema.
Un saludo _________________ C retains the basic philosophy that programmers know what they are doing; it only requires that they state their intentions explicitly. -- Kernighan & Ritchie, The C programming language |
|
| Volver arriba | |
 |
daltomi
Registrado: 28 Abr 2007 Mensajes: 335 Ubicación: Argentina
| Publicado: 07/07/2012 8:13 pm | | | Título: |
| El archivo Makefile-Debug.mk lo genera el IDE, ese puede ser el problema. Intenta lo siguiente: Crea un directorio temporal y copia los sources files al mismo. Por ejemplo, main.c,*.h, etc. Luego en una terminal, estando en directorio temportal que creaste( y en donde copiaste previamente los source files) ejecuta lo siguiente: g++ `xml2-config --cflags --libs` *.cpp (Nota la comilla simple.) Donde *.cpp puede ser *.c en tu caso y donde g++ pueder ser gcc. Si compila, el problema esta en tu IDE. En otro caso, publica cualquier error del compilador y ademas el comando: xml2-config --cflags --libs
Saludos.
PS: el enterior comando compila perfectamente con el codigo de ejemplo(sospechoso) del siguiente link |
|
| Volver arriba | |
 |
janet20
Registrado: 03 Jul 2012 Mensajes: 3
| Publicado: 10/07/2012 5:54 am | | | Título: Problema resuelto |
| Problema resuelto para compilar por linea de comando queda así:
janet@maq1:~$ gcc `xml2-config --cflags --libs` -o test test.c janet@maq1:~$ ./test
y con IDE faltaba agregar el linker de libraries.
gracias por su ayuda.
Saludos |
|
| Volver arriba | |
 |
|
|