Ошибка компиляции примера Nana (nana v1.1.2 / 1.1.3) с gcc 4.8.4 / clang3.4

Я попробовал последнюю версию nana (1.1.2 / 1.1.3), загруженную с Github. Библиотека компилируется нормально. Когда я пытаюсь скомпилировать и связать любой пример программы с Linux (gcc 4.8.4, clang 3.4), я получаю следующие ошибки:

enter In file included from /installs/nana/include/nana/gui/wvl.hpp:20:
In file included from /installs/nana/include/nana/gui/widgets/form.hpp:16:
In file included from /installs/nana/include/nana/gui/widgets/widget.hpp:17:
/installs/nana/include/nana/internationalization.hpp:69:7: error: invalid operands to binary expression ('std::wstringstream' (aka 'basic_stringstream<wchar_t>') and 'nana::string' (aka 'basic_string<char>'))
ss << nana::string(nana::charset(arg));
~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8 /system_error:186:5: note: candidate function [with _CharT = wchar_t, _Traits = std::char_traits<wchar_t>] not viable: no known conversion from 'nana::string' (aka 'basic_string<char>') to 'const std::error_code' for 2nd argument
operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ostream:108:7: note: candidate function not viable: no known conversion from 'nana::string' (aka 'basic_string<char>') to '__ostream_type &(*)(__ostream_type &)' for 1st argument
operator<<(__ostream_type& (*__pf)(__ostream_type&))
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ostream:117:7: note: candidate function not viable: no known conversion from 'nana::string' (aka 'basic_string<char>') to '__ios_type &(*)(__ios_type &)' for 1st argument
operator<<(__ios_type& (*__pf)(__ios_type&))
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ostream:127:7: note: candidate function not viable: no known conversion from 'nana::string' (aka 'basic_string<char>') to 'std::ios_base &(*)(std::ios_base &)' for 1st argument
operator<<(ios_base& (*__pf) (ios_base&))
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ostream:166:7: note: candidate function not viable: no known conversion from 'nana::string' (aka 'basic_string<char>') to 'long' for 1st argument
operator<<(long __n)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ostream:170:7: note: candidate function not viable: no known conversion from 'nana::string' (aka 'basic_string<char>') to 'unsigned long' for 1st argument
operator<<(unsigned long __n)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ostream:174:7: note: candidate function not viable: no known conversion from 'nana::string' (aka 'basic_string<char>') to 'bool' for 1st argument
operator<<(bool __n)here

CMake:

cmake_minimum_required(VERSION 3.2)
project(nana_ui)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11
-DSTD_CODECVT_NOT_SUPPORTED")
SET(NANA_BASE "/installs/nana")
include_directories(${NANA_BASE}/include
/usr/include/freetype2)
link_directories(${NANA_BASE}/lib)

set(SOURCE_FILES main.cpp)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ${NANA_BASE}/lib/libnana.a
X11 pthread rt Xft png asound)

Пример cpp:

#include <nana/gui.hpp>
#include <nana/gui/widgets/label.hpp>

int main()
{
using namespace nana;
form fm;
label lb(fm, fm.size());
lb.caption(L"Hello, World");
fm.show();
exec();
}

Любая помощь приветствуется.

1

Решение

Добавляем #define NANA_UNICODE в config.hpp, затем перекомпилируем библиотеку и примеры

1

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]