Skip to content

Updated example.c to work with newer versions of g++ - #38

Merged
hbf merged 1 commit into
hbf:masterfrom
janbridley:fix-#37
Aug 10, 2023
Merged

hbf merged 1 commit into
hbf:masterfrom
janbridley:fix-#37

Conversation

@janbridley

Copy link
Copy Markdown
Contributor

As in #37, example.c cannot be compiled as written on g++ versions 10 or newer. The following error results from attempting to compile the script:

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

A very similar error is raised on x86-64 linux systems as well. The change proposed in 7532079 works for g++-11, g++-12, g++-13, and g++-14 on macOS arm64 and g++-10 on Red Hat linux x86-64.

The line #include "Seb_debug.h" is not required for proper function on any of the versions of g++ tested, but has been left in to improve backwards compatibility.

@hbf

hbf commented Aug 10, 2023

Copy link
Copy Markdown
Owner

Thanks for the fix, @janbridley.

If you'd like to be mentioned in the contributors section (https://github.com/hbf/miniball#authors--acknowledgements), feel free to submit a PR.

@hbf
hbf merged commit e32693e into hbf:master Aug 10, 2023
@janbridley janbridley mentioned this pull request Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants