Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example.c cannot be properly compiled #37

Closed
janbridley opened this issue Aug 9, 2023 · 0 comments
Closed

example.c cannot be properly compiled #37

janbridley opened this issue Aug 9, 2023 · 0 comments

Comments

@janbridley
Copy link
Contributor

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

  • 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

Linux

  • Red Hat Linux 8.6
g++ -v 

>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)
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

No branches or pull requests

1 participant