krychu / wfc

Wave Function Collapse library in C, plus a command-line tool
349 stars 20 forks source link

Compiling requires -lm for some targets #3

Closed vwood closed 2 years ago

vwood commented 2 years ago

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
$
krychu commented 2 years ago

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