JCash / voronoi

A C implementation for creating 2D voronoi diagrams
MIT License
638 stars 94 forks source link

Suggestion for easier user experience #61

Closed liuyinglao closed 1 year ago

liuyinglao commented 3 years ago

Hey @JCash this is super helpful. I am new to github/C/C++/Voronoi, but I can still make my own Voronoi image!

This is just a light suggestion from a C beginner standpoint -- feel free to close if that doesn't make sense to you! When I fork and clone to my repo and run "cd src && gcc main.c -o main " it will complain the

yinglaoliu@Yinglaos-MacBook-Pro src % gcc main.c -o main
Undefined symbols for architecture x86_64:
  "_wrap_stbi_write_png", referenced from:
      _main in main-3c1ce3.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

the quick fix is to add this to the header of main.c

#include "stb_wrapper.c"

in the test.c file I will also need to include

#include "../src/jc_voronoi.h"

to get it run.

feel free to lmk what do you think? I can help submit a PR if you like.

Thanks again for the help!

JCash commented 1 year ago

Thanks, but including .c files is not something I generally do/support. Especially since digferent libraries often require digferent build settings.

To build the src, use the compil.sh/compile_cl.bat scripts.