Tyl*_*eat 0 c linker gcc makefile
我遇到了GCC链接器的问题,特别是使用了-lm标志,因为我正在使用math.h中的一些函数.我收到以下错误:
main.c :(.text + 0x8e5):未定义引用`floor'
main.c :(.text + 0x901):未定义的引用`ceil'
这是我的makefile的相关部分:
myprogram: main.o
gcc -Wall -pedantic -o myprogram main.o
main.o: main.c foo.h bar.h
gcc -Wall -pedantic -lm main.c
Run Code Online (Sandbox Code Playgroud)
我可能会忽略一些愚蠢的东西,但在制作文件方面,我绝对不是专家.
| 归档时间: |
|
| 查看次数: |
1867 次 |
| 最近记录: |