感谢所有帮助。我尝试了您的建议,但仍然遇到相同的错误。所以我决定提供更多细节,以便您能够向我提供更多建议。
我想使用基于文本的界面 (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;
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]:进入目录/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 构建/调试/MinGW-Windows/_ext/3a58e87f
rm -f "构建/调试/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:致命错误:ftxui/component/checkbox.hpp:没有这样的文件或目录
#include "ftxui/component/checkbox.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
编译终止。
make.exe[2]: *** [build/Debug/MinGW-Windows/_ext/3a58e87f/checkbox.o] 错误 1
make.exe[2]:离开目录/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] 错误 2
BUILD FAILED(退出值2,总时间:2s)