Heute habe ich meine C++ - Anwendung neu erstellt und die Kompilierung fehlgeschlagen. Nichts hat sich jedoch verändert. Der erste Fehler war in meiner Klasse List
, die von std::vector
(privaten Vererbung) erbt hier:Kompilierung fehlgeschlagen in Boost librairies (program_options)
template<typename T> void List<T>::append(const T& value)
{
push_back(value);
}
I std::vector<T>::
vor push_back(value);
hinzufügen musste, weil keine Erklärungen vom Compiler gefunden wurden. Ich weiß nicht wirklich warum es passiert, aber es gab ein Update von g ++, ich benutze nun g ++ v4.7.0 (Vorabversion) mit C++ 11 auf Arch Linux.
Ich behoben dieses Problem, aber jetzt, das eigentliche Problem, ist, dass ich den Rest der Anwendung wegen eines Problems in der Boost-Bibliothek program_options
nicht kompilieren kann. Ich schließe die Bibliothek mit:
#include <boost/config.hpp>
#include <boost/program_options/detail/config_file.hpp>
#include <boost/program_options/parsers.hpp>
Die Fehler:
g++ -m64 -pipe -pedantic -Wextra -std=gnu++0x -c -g -Wall -DDEBUG -DDEV -DMYSQL_SUPPORT -I. -IHeaders -MMD -MP -MF build/Debug/GNU-Linux-x86/Sources/Libs/Settings.o.d -o build/Debug/GNU-Linux-x86/Sources/Libs/Settings.o Sources/Libs/Settings.cpp
/usr/include/boost/program_options/detail/config_file.hpp: In instantiation of ‘bool boost::program_options::detail::basic_config_file_iterator<charT>::getline(std::string&) [with charT = char; std::string = std::basic_string<char>]’:
In file included from Sources/Libs/Settings.cpp:33:0:
Sources/Libs/Settings.cpp:69:24: required from here
/usr/include/boost/program_options/detail/config_file.hpp:163:13: erreur: ‘to_internal’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
In file included from /usr/include/boost/program_options/detail/parsers.hpp:9:0,
from /usr/include/boost/program_options/parsers.hpp:265,
from Sources/Libs/Settings.cpp:34:
/usr/include/boost/program_options/detail/convert.hpp:75:34: note: ‘template<class T> std::vector<std::basic_string<char> > boost::program_options::to_internal(const std::vector<T>&)’ declared here, later in the translation unit
Die gleichen Fehler als mit meiner List-Klasse ...
Vielen Dank!