无法使用娜娜图书馆 [英] Cannot use nana library
问题描述
我尝试将Nana库与Code :: Block IDE结合使用。我进行了所有设置,例如此处
I try to use Nana library with Code::Block IDE. I made all settings like here
并添加-std = C ++ 11标志和Boost包含路径,但会在构建时显示下一个错误:
and add -std=C++11 flag and Boost include path but it's print next error on building:
nana / include / nana / paint / graphics.hpp | 143 |错误: unsigned int nana :: paint :: graphics :: bidi_string(const nana :: point& ;, const char *,std :: size_t)'不能重载|
nana / include / nana / paint / graphics.hpp | 142 |错误:
与'unsigned int nana :: paint :: graphics :: bidi_string(const nana :: point& ;, const char_t *,std :: size_t)'|
nana/include/nana/paint/graphics.hpp|143|error: ‘unsigned int nana::paint::graphics::bidi_string(const nana::point&, const char*, std::size_t)’ cannot be overloaded|
nana/include/nana/paint/graphics.hpp|142|error: with ‘unsigned int nana::paint::graphics::bidi_string(const nana::point&, const char_t*, std::size_t)’|
我只开始研究C ++ 11标准和Nana GUI库,无法理解这些错误。
I only start study C++ 11 standart and Nana GUI library and cannot understand these bugs.
推荐答案
我遇到了同样的问题。
为了解决问题,我看了 nana
如何通过用<$编译 nana
来解决这个问题。 c $ c> make VERBOSE = 1 ,
并从中获取定义。
I faced the same problem.
To solve problem I look at how nana
it self deal with this problem by compiling nana
with make VERBOSE=1
,
and take defines from it.
以编译后的示例为例:
#include<nana/gui.hpp>
int main()
{
using namespace nana;
form fm;
drawing{fm}.draw([](paint::graphics& graph){
graph.string({10, 10}, L"Hello, world!", colors::red);
});
fm.events().click(API::exit);
fm.show();
exec();
}
来自nana网站( http://nanapro.org/en-us/ )我使用以下命令行:
from nana site(http://nanapro.org/en-us/) I use such command line:
g++ -DNANA_ENABLE_PNG -DNANA_LIBPNG -DNANA_LINUX -DNANA_UNICODE \
-DNANA_X11 -DPLATFORM_SPEC_HPP="<nana/detail/linux_X11/platform_spec.hpp>" \
-DSTD_CODECVT_NOT_SUPPORTED -std=c++11 -I nana/include/ \
test.cpp build/libnana.a -lX11 -lXft -lpthread -lpng
这篇关于无法使用娜娜图书馆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!