value *= pow(10, 3); // this one compiles
value *= pow(10, aVar); // this one produces this error:
//Number.c:(.text+0x469): undefined reference to `pow'
aVarはint変数です。
どうなり得るか?
私はmakefileを使用しています。「makelexanc」を実行しています。makefileは次のようになります。
lexanc: lexandr.o lexanc.o scanner.o printtoken.o token.h lexan.h Number.o
cc -o lexanc -lm lexandr.o lexanc.o scanner.o printtoken.o Number.o
...
Number.o: Number.c Number.h lexan.h
cc -c Number.c
lexanc.o: lexanc.c token.h lexan.h Number.h
cc -c lexanc.c
...
私のccバージョンは次のとおりです:laygr @ xxx $ cc --version cc(Ubuntu / Linaro 4.6.3-1ubuntu5)4.6.3