Nana官网地址:nanapro.org
简单示例:NanaDemo.cpp
#include <nana/gui.hpp> #include <nana/gui/widgets/button.hpp> #pragma comment(lib, "nana_v140_Debug_x64.lib") int main() { using namespace nana; form fm; fm.caption(L"Nana简单示例"); button btn(fm, rectangle(50, 50, 200, 100)); btn.caption(L"世界,你好!"); btn.events().click([&fm]() { msgbox mb(fm, "Hello World!"); mb.icon(msgbox::icon_information); mb << L"Hello World! 世界,你好!"; mb.show(); }); fm.show(); exec(); return 0; }
为避免控制台窗口的弹出,可使用预处理指令#pragma comment(linker, "/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
或者进入工程属性,将链接器->系统中的子系统设为Windows,将链接器->高级中的入口点设为mainCRTStartup
https://www.cnblogs.com/buyishi/p/9189677.html