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

Configure attempts to compile c++ code with gcc but not with g++ #160

Open
dmitriy-chizhov90 opened this issue Dec 13, 2021 · 2 comments
Open

Comments

@dmitriy-chizhov90
Copy link

dmitriy-chizhov90 commented Dec 13, 2021

./configure fails with error
checking for library containing clock_gettime... no
configure: error: librt not found
while attempting to compile c++ code with gcc compiler:
configure:6260: gcc -o conftest -g -O2 conftest.c >&5
conftest.c:35:1: error: unknown type name 'namespace'
35 | namespace conftest {
| ^~~~~~~~~
conftest.c:35:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
35 | namespace conftest {
| ^
conftest.c: In function 'main':
conftest.c:41:8: error: 'conftest' undeclared (first use in this function)
41 | return conftest::clock_gettime ();
| ^~~~~~~~
conftest.c:41:8: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:41:16: error: expected ';' before '::' token
41 | return conftest::clock_gettime ();
| ^~
| ;

./configure CC=g++ may be used as workaround.

@dolby360
Copy link

What is the compiler version?

@dmitriy-chizhov90
Copy link
Author

uname -m = x86_64
uname -r = 5.15.6-arch2-1
uname -s = Linux
uname -v = #1 SMP PREEMPT Thu, 02 Dec 2021 15:47:09 +0000

configure:3755: checking for g++
configure:3776: found /usr/bin/g++
configure:3787: result: g++
configure:3814: checking for C++ compiler version
configure:3823: g++ --version >&5
g++ (GCC) 11.1.0

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

2 participants