c++ - Nana 用 C++ 制作 GUI

标签 c++ user-interface build g++ nana

我正在尝试用 C++ 制作一个轻量级 GUI 应用程序,有人建议我使用 Nana library .

我下载了 zip 文件,但我不知道如何继续。我解压它并根据instructions ,我必须

Create a static linkage library solution within a IDE which you use, and add >all the files which are placed in NanaPath/source and in all its sub >directories to the solution. Then compile the solution and you will get a >static linkage file NanaStatic in the path NanaPath/build/bin/IDEName.

(第二步)

我不明白的是,如何“创建静态链接库”?我没有使用任何 IDE(而且很可能我也不会使用)。我现在拥有的只是解压缩的文件。我正在使用 MinGW g++ 编译器。

我已阅读以下帖子(不允许发布超过两个链接)

How to create a static library with g++?

How to compile nana into static lib

Creating static library from multiple sources

但我找不到构建和使用 Nana 的直接方法。

您能给我一些指南吗?我想如果我知道如何编译 HelloWorld 示例(此处直接引用),我就可以继续构建我的应用程序。

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

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

提前致谢。

更新:错误(仅一小部分):

enter image description here

最佳答案

查看Nana的文件夹结构,根文件夹中有一个build文件夹。在它下面,两个文件夹引起了我的注意:

  • 生成文件
  • cmake

我没有太多使用 cmake,但使用了大量的 makefile 来编译项目。您应该能够通过进入 build/makefile 并执行命令 make(如果您在 Linux 下)来开始构建工作。这将启动编译和构建过程。

此后,您唯一需要做的就是在编译 HelloWorld 示例时链接到输出库。

关于c++ - Nana 用 C++ 制作 GUI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30693892/

相关文章:

c++ - C++中的方法和成员有什么区别?

c++ - std::deque 或 std::list

c++ - 如何在 C++ 中删除与 typeid( ).name( ) 关联的数字?

java - 如何关闭 Activity 的 JFrame

java - 使用单选按钮更改 GUI 的颜色

java - 我可以使用Ant来记录发布历史吗?

c++ - 跨平台构建库而不运行所有平台

c++ - 抛出表达式中是否允许右值省略

Android-NDK:从 native 代码创建 GUI 元素

java - 自动构建并将 zip/tar.gz 推送到网站目录