
Hola necesito hacer algunas pruebas con un Kit de herramientas CP ABE que he encontrado, Soy un novato total en Linux, comencé a usarlo hace unos días, así que tengan paciencia. He encontradoeste vídeotutorialeso fue bastante útil y me hizo instalar: -lenguaje de procesamiento de macros m4 -biblioteca gmp -biblioteca pbc -libcrypt -libssl -libglib2.0 -biblioteca libbswabe
He seguido cada pasaje del video, pero cuando tengo que compilar el paquete cpabe después de realizarlo, aparece este error (aunque no parece ser el caso en el tutorial)
~/Downloads/cpabe-0.11$ make
gcc -c -o setup.o setup.c -O3 -Wall -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/pbc -I/usr/local/include/pbc -DPACKAGE_NAME=\"cpabe\" -DPACKAGE_TARNAME=\"cpabe\" -DPACKAGE_VERSION=\"0.11\" -DPACKAGE_STRING=\"cpabe\ 0.11\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_FCNTL_H=1 -DHAVE_STDDEF_H=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DLSTAT_FOLLOWS_SLASHED_SYMLINK=1 -DHAVE_VPRINTF=1 -DHAVE_LIBCRYPTO=1 -DHAVE_LIBCRYPTO=1 -DHAVE_STRCHR=1 -DHAVE_STRDUP=1 -DHAVE_MEMSET=1 -DHAVE_GMP=1 -DHAVE_PBC=1 -DHAVE_BSWABE=1
gcc -c -o common.o common.c -O3 -Wall -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/pbc -I/usr/local/include/pbc -DPACKAGE_NAME=\"cpabe\" -DPACKAGE_TARNAME=\"cpabe\" -DPACKAGE_VERSION=\"0.11\" -DPACKAGE_STRING=\"cpabe\ 0.11\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_FCNTL_H=1 -DHAVE_STDDEF_H=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DLSTAT_FOLLOWS_SLASHED_SYMLINK=1 -DHAVE_VPRINTF=1 -DHAVE_LIBCRYPTO=1 -DHAVE_LIBCRYPTO=1 -DHAVE_STRCHR=1 -DHAVE_STRDUP=1 -DHAVE_MEMSET=1 -DHAVE_GMP=1 -DHAVE_PBC=1 -DHAVE_BSWABE=1
common.c: In function ‘suck_file’:
common.c:137:2: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread(a->data, 1, s.st_size, f);
^
common.c: In function ‘read_cpabe_file’:
common.c:211:2: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread((*aes_buf)->data, 1, len, f);
^
common.c:218:2: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread((*cph_buf)->data, 1, len, f);
^
gcc -o cpabe-setup setup.o common.o -O3 -Wall -lglib-2.0 -Wl,-rpath /usr/local/lib -lgmp -Wl,-rpath /usr/local/lib -lpbc -lbswabe -lcrypto -lcrypto
/usr/bin/ld: /usr/local/lib/libpbc.so: undefined reference to symbol '__gmpz_init'
/usr/local/lib/libgmp.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:34: recipe for target 'cpabe-setup' failed
make: *** [cpabe-setup] Error 1
Gracias
Respuesta1
Abra el Makefile y busque las siguientes líneas:
LDFLAGS = -O3 -Wall \
-lglib-2.0 \
-Wl,-rpath /usr/local/lib -lgmp \
-Wl,-rpath /usr/local/lib -lpbc \
-lbswabe \
-lcrypto -lcrypto
Ahora simplemente agregue un -lgmp
lado -lcrypto
y será exitoso.
LDFLAGS = -O3 -Wall \
-lglib-2.0 \
-Wl,-rpath /usr/local/lib -lgmp \
-Wl,-rpath /usr/local/lib -lpbc \
-lbswabe \
-lcrypto -lcrypto -lgmp