krychu / wfc

Wave Function Collapse library in C, plus a command-line tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiling requires -lm for some targets

vwood opened this issue · comments

commented

On ubuntu x64 20.10:

$ make
cc wfctool.c -g -DWFC_TOOL -o wfc
/usr/bin/ld: /tmp/ccsapR95.o: in function `stbi__ldr_to_hdr':
/home/user/workspace/wfc/wfc_c/stb_image.h:1849: undefined reference to `pow'
/usr/bin/ld: /tmp/ccsapR95.o: in function `stbi__hdr_to_ldr':
/home/user/workspace/wfc/wfc_c/stb_image.h:1875: undefined reference to `pow'
/usr/bin/ld: /tmp/ccsapR95.o: in function `wfc__propagate_prop':
/home/user/workspace/wfc/wfc_c/wfc.h:995: undefined reference to `log'
/usr/bin/ld: /home/user/workspace/wfc/wfc_c/wfc.h:998: undefined reference to `log'
/usr/bin/ld: /tmp/ccsapR95.o: in function `wfc__init_cells':                                 
/home/user/workspace/wfc/wfc_c/wfc.h:1082: undefined reference to `log'                      
/usr/bin/ld: /home/user/workspace/wfc/wfc_c/wfc.h:1084: undefined reference to `log'         
collect2: error: ld returned 1 exit status                                                   
make: *** [Makefile:2: make] Error 1
$

whereas:

$ make
cc wfctool.c -g -DWFC_TOOL -o wfc -lm
$

Thanks this was fixed in PR by @smcameron (thanks!)