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

example.c cannot be properly compiled #37

Closed janbridley closed 6 months ago

janbridley commented 1 year ago

Issue Description

Running the provided code to compile example.c results in the following error:

macOS arm64


g++ -I../main example.C -o example -O3
>Undefined symbols for architecture arm64:
>  "Seb::Timer::lapse(char const*)", referenced from:
>      _main in example-897173.o
>  "Seb::Timer::start(char const*)", referenced from:
>      _main in example-897173.o
>  "Seb::Timer::instance()", referenced from:
>      _main in example-897173.o
>ld: symbol(s) not found for architecture arm64

Red Hat linux 8.6

g++ -I../main example.C -o example
>/tmp/ccPkORl3.o: In function `main':
>example.C:(.text+0x435): undefined reference to `Seb::Timer::instance()'
>example.C:(.text+0x442): undefined reference to `Seb::Timer::start(char const*)'
>example.C:(.text+0x4a4): undefined reference to `Seb::Timer::instance()'
>example.C:(.text+0x4b1): undefined reference to `Seb::Timer::lapse(char const*)'
>collect2: error: ld returned 1 exit status

Solution

Changing the line #include "Seb_debug.h" to #include "Seb_debug.C" fixes the issue.

A PR will be posted to address this

Environment

macOS

Apple clang version 14.0.3 (clang-1403.0.22.14.1) Target: arm64-apple-darwin22.4.0 Thread model: posix

Linux

Target: x86_64-pc-linux-gnu Configured with: ../gcc-10.3.0/configure --prefix=/sw/pkgs/arc/gcc/10.3.0 --mandir=/sw/pkgs/arc/gcc/10.3.0/share/man --enable-languages=c,c++,fortran --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.3.0 (GCC)