Cannot use nana library

梦想与她 提交于 2019-12-11 11:53:21

问题


I try to use Nana library with Code::Block IDE. I made all settings like here

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|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)’|

I only start study C++ 11 standart and Nana GUI library and cannot understand these bugs.


回答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.

So to compiled example:

#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();
}

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


来源:https://stackoverflow.com/questions/33543674/cannot-use-nana-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!