Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
eMPee584 opened this issue Jan 6, 2016 · 3 comments
Closed

Comments

@eMPee584
Copy link

@eMPee584 eMPee584 commented Jan 6, 2016

馃槩

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
Copy link
Author

@eMPee584 eMPee584 commented Jan 6, 2016

..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
Copy link

@mnebelung mnebelung commented Jan 20, 2016

Add -fgnu89-inline to CFLAGS in the Makefile

@daniesy
Copy link

@daniesy daniesy commented Jan 26, 2018

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;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants