twindb / undrop-for-innodb

TwinDB data recovery toolkit for MySQL/InnoDB
https://twindb.com
GNU General Public License v2.0
384 stars 148 forks source link

error: ld returned 1 exit status / undefined reference to `make_longlong' #3

Closed eMPee584 closed 6 years ago

eMPee584 commented 8 years ago

:cry:

cc -D_FILE_OFFSET_BITS=64 -Wall -g -O3 -pipe -std=gnu89  -I./include  sql_parser.o c_parser.o tables_dict.o print_data.o check_data.o -o c_parser -pthread -lm
print_data.o: In function `guess_datetime_format':
/usr/src/repositories/undrop-for-innodb/print_data.c:35: undefined reference to `make_longlong'
/usr/src/repositories/undrop-for-innodb/print_data.c:35: undefined reference to `make_longlong'
print_data.o: In function `print_datetime':
/usr/src/repositories/undrop-for-innodb/print_data.c:85: undefined reference to `make_longlong'
print_data.o: In function `get_uint_value':
/usr/src/repositories/undrop-for-innodb/print_data.c:224: undefined reference to `make_ulonglong'
/usr/src/repositories/undrop-for-innodb/print_data.c:221: undefined reference to `make_ulonglong'
/usr/src/repositories/undrop-for-innodb/print_data.c:222: undefined reference to `make_ulonglong'
/usr/src/repositories/undrop-for-innodb/print_data.c:223: undefined reference to `make_ulonglong'
print_data.o: In function `get_int_value':
/usr/src/repositories/undrop-for-innodb/print_data.c:251: undefined reference to `make_ulonglong'
print_data.o:/usr/src/repositories/undrop-for-innodb/print_data.c:251: more undefined references to `make_ulonglong' follow
print_data.o: In function `guess_datetime_format':
/usr/src/repositories/undrop-for-innodb/print_data.c:35: undefined reference to `make_longlong'
print_data.o: In function `print_datetime':
/usr/src/repositories/undrop-for-innodb/print_data.c:85: undefined reference to `make_longlong'
print_data.o: In function `get_int_value':
/usr/src/repositories/undrop-for-innodb/print_data.c:251: undefined reference to `make_ulonglong'
/usr/src/repositories/undrop-for-innodb/print_data.c:251: undefined reference to `make_ulonglong'
print_data.o: In function `get_uint_value':
/usr/src/repositories/undrop-for-innodb/print_data.c:224: undefined reference to `make_ulonglong'
/usr/src/repositories/undrop-for-innodb/print_data.c:223: undefined reference to `make_ulonglong'
/usr/src/repositories/undrop-for-innodb/print_data.c:222: undefined reference to `make_ulonglong'
print_data.o:/usr/src/repositories/undrop-for-innodb/print_data.c:221: more undefined references to `make_ulonglong' follow
collect2: error: ld returned 1 exit status
Makefile:55: recipe for target 'c_parser' failed
make: *** [c_parser] Error 1
eMPee584 commented 8 years ago

..oh, the -std=gnu89 was a left-over... tried them all because I read it would change the dealings of inline functions, but it didn't help.

mnebelung commented 8 years ago

Add -fgnu89-inline to CFLAGS in the Makefile

daniesy commented 6 years ago

I've managed to get it working by adding these functions in the print_data.c file.

inline longlong make_longlong(dulint x) {
    longlong lx = x.high;
    lx <<= 32;
    lx += x.low;
    return lx;
}

inline ulonglong make_ulonglong(dulint x) {
    ulonglong lx = x.high;
    lx <<= 32;
    lx += x.low;
    return lx;
}