【发布时间】:2020-08-21 22:09:47
【问题描述】:
我想创建一个基于文本的界面 (TUI) 软件。我在 GitHub 上找到了 FTXUI 库,想用它,所以我把它下载到我的电脑上。项目存储库结构为:
FTXUI-master
├───.github
├───doc
├───examples
│ ├───component
│ ├───dom
│ ├───html
│ └───util
├───include
│ └───ftxui
│ ├───component
│ ├───dom
│ ├───screen
│ └───util
├───other
└───src
└───ftxui
├───component
├───dom
└───screen
我正在使用 Netbeans 8.2 RC 和 Mingw-w64 编译器,首先我尝试在 Netbeans 中添加包含和源,添加“包含”和 “src”从 FTXUI 到 Netbeans 中的包含和源文件路径,如下所示:
CppApplication
│
│
├───HeaderFiles
│ └include
│ └───ftxui
│ ├───component
│ ├───dom
│ ├───screen
│ └───util
│
├───SourceFiles
│ └──main.cpp
│ └src
│ └───ftxui
│ ├───component
│ ├───dom
│ ├───screen
│ └───util
├───TestFiles
└───ImportantFiles
main.cpp文件内容为:
#include <cstdlib>
#include "ftxui/dom/elements.hpp"
#include "ftxui/screen/screen.hpp"
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
using namespace ftxui;
// Define the document
Element document =
hbox({
text(L"left") | border,
text(L"middle") | border | flex,
text(L"right") | border,
});
auto screen = Screen::Create(
Dimension::Full(), // Width
Dimension::Fit(document) // Height
);
Render(screen, document);
std::cout << screen.ToString() << std::endl;
return 0;
}
我得到的输出是:
cd 'C:\Users\CurrentUser\Documents\NetBeansProjects\CppApplication_2'
C:\msys\1.0\bin\make.exe -f Makefile CONF=Debug
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/CurrentUser/Documents/NetBeansProjects/CppApplication_2'
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/cppapplication_2.exe
make.exe[2]: Entering directory `/c/Users/CurrentUser/Documents/NetBeansProjects/CppApplication_2'
mkdir -p build/Debug/MinGW-Windows/_ext/3a58e87f
rm -f "build/Debug/MinGW-Windows/_ext/3a58e87f/checkbox.o.d"
g++ -c -g -MMD -MP -MF "build/Debug/MinGW-Windows/_ext/3a58e87f/checkbox.o.d" -o build/Debug/MinGW-Windows/_ext/3a58e87f/checkbox.o ../../../Desktop/FTXUI-master/FTXUI-master/src/ftxui/component/checkbox.cpp
../../../Desktop/FTXUI-master/FTXUI-master/src/ftxui/component/checkbox.cpp:5:10: fatal error: ftxui/component/checkbox.hpp: No such file or directory
#include "ftxui/component/checkbox.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make.exe[2]: *** [build/Debug/MinGW-Windows/_ext/3a58e87f/checkbox.o] Error 1
make.exe[2]: Leaving directory `/c/Users/CurrentUser/Documents/NetBeansProjects/CppApplication_2'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/CurrentUser/Documents/NetBeansProjects/CppApplication_2'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
提前感谢您的帮助。
【问题讨论】: