Skip to content

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

@dmitriy-chizhov90

Description

@dmitriy-chizhov90

./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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions