hbf / miniball

Fast computation of the smallest enclosing ball of a point set, in low or moderately high dimensions.
133 stars 41 forks source link

Build error on MSVC due to POSIX headers (sys/resource.h, sys/time.h) include in Seb_debug.h #26

Open quxflux opened 4 years ago

quxflux commented 4 years ago

When compiling a project which includes "Seb.h" using MSVC, compilation will fail due to the missing POSIX headers:

cpp\main/Seb_debug.h(12,10): fatal error : 'sys/resource.h' file not found

I was able to work around this in a fork of the repo by forward declaring the used timeval struct.

A cleaner way would probably to either git rid of the POSIX header dependency and rely solely on functionality from the C++ standard library (e.g. std::chrono) or at least prevent the compiler from hitting the mentioned include when SEB_DEBUG_MODE is not defined.

hbf commented 4 years ago

@TheGrumpyCoda Thanks a lot for reporting this. If you have time to submit a PR, feel free to do so—very happy to take your fix/improvement in, pc course!