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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis-stat unable to build on Ubuntu 12.04 64-bit #6

Open
andrewgross opened this issue Jul 10, 2013 · 1 comment
Open

redis-stat unable to build on Ubuntu 12.04 64-bit #6

andrewgross opened this issue Jul 10, 2013 · 1 comment

Comments

@andrewgross
Copy link

Had an issue where it could not be built:

cc -o redis-stat -std=c99 -pedantic -O2 -Wall -W   -lm -pthread   -g -rdynamic -ggdb  redis-stat.o zmalloc.o utils.o deps/hiredis/libhiredis.a
redis-stat.o: In function `samplesToGraph':
/root/redis-tools/redis-stat.c:460: undefined reference to `pow'

The problem is the -lm flag needs to move to the end of the line, due to the way gcc loads things. If the make line is switched to the following, it works fine:

cc -o redis-stat -std=c99 -pedantic -O2 -Wall -W  -pthread   -g -rdynamic -ggdb redis-stat.o zmalloc.o utils.o deps/hiredis/libhiredis.a -lm

I am not the best with C compilation, so I am unsure if this is an OS specific issue, or applies to GCC in general.

System Info:
GCC: gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Uname: Linux redis 3.2.0-31-virtual #50-Ubuntu SMP Fri Sep 7 16:36:36 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Git Hash of Repo: 0f46ef40e6f178464c4c7bc3070c24ad5b5e0ec8

@9point6
Copy link

9point6 commented May 16, 2014

+1

putting "-lm" on the end of lines 39 & 46 for an inelegant solution works.

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

No branches or pull requests

2 participants