Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

243
Visualizações
mismatched c++ header versions

I've just installed g++ 4.8 on my ubuntu system in order to meet some prerequisites. But now I'm seeing some c++ compilation errors like this one:

build command:
g++-4.8 -m64 -std=c++0x -c -g -I/usr/include/jsoncpp/json -std=c++0x -MMD -MP -MF build/Debug/GNU-Linux-x86/_ext/803384703/CharNode.o.d -o build/Debug/GNU-Linux-x86/_ext/803384703/CharNode.o ../doublets/CharNode.cpp

Error:

In file included from /usr/include/x86_64-linux-gnu/c++/4.8/bits/c++config.h:420:0,
             from /usr/include/c++/4.8/bits/stl_algobase.h:59,
             from /usr/include/c++/4.8/bits/stl_tree.h:61,
             from /usr/include/c++/4.8/map:60,
             from ../doublets/CharNode.h:13,
             from ../doublets/CharNode.cpp:9:

/usr/include/x86_64-linux-gnu/c++/4.8/bits/os_defines.h:44:19: error: missing binary operator before token "("
#if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE)
                  ^

It seems to be complaining about the parenthesis?

Also, (on other errors) I think there's a version mismatch between wchar.h (c99) and everything else which is c++0x (C11). Any ideas how to get ahold of the c11 standard headers and install them in ubuntu?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Fixed.

The problem was in the build command:

g++-4.8 -m64 -std=c++0x -c -g -I/usr/include/jsoncpp/json -std=c++0x -MMD -MP -MF build/Debug/GNU-Linux-x86/_ext/803384703/CharNode.o.d -o build/Debug/GNU-Linux-x86/_ext/803384703/CharNode.o ../doublets/CharNode.cpp

The -I command includes directories to search when locating header files. Both os_defines.h and my own files include reference to different header files with the same name: features.h. I think there's a standard one and there's one in the jsoncpp library that I was using.

The problem was that the -I command above went one directory too far and should not have had the /json on the end. The standard libraries refer to this file as features.h, and internally jsoncpp does the same for its own features.h file.

Had I looked down the thousands of generated errors I would have seen that my own references to the jsoncpp libraries header files were resulting in a "header file not found" error, but I didn't get this far.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda