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
Operating System: macOS 13.3.1,
g++ -v
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.4.0
Thread model: posix
Issue Description
Running the provided code to compile example.c results in the following error:
macOS arm64
Red Hat linux 8.6
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
Linux