我尝试使用public class FXML_MainController implements Initializable {
@FXML
private Label displayTextBottom;
final KeyCombination keyShiftPlus = new KeyCodeCombination(KeyCode.EQUALS, KeyCombination.SHIFT_ANY);
final KeyCombination keyShiftMul = new KeyCodeCombination(KeyCode.DIGIT8, KeyCombination.SHIFT_ANY);
final KeyCombination keyShiftDiv = new KeyCodeCombination(KeyCode.SLASH, KeyCombination.SHIFT_ANY);
@FXML
void btnOnKeyPressed(KeyEvent event) {
if (keyShiftPlus.match(event) || event.getCode() == KeyCode.ADD) {
field.setText("+");
System.out.println("+ ADD");
event.consume();
}
if (keyShiftMul.match(event) || event.getCode() == KeyCode.MULTIPLY) {
field.setText("*");
System.out.println("* Mul");
event.consume();
}
if (keyShiftDiv.match(event) || event.getCode() == KeyCode.DIVIDE) {
field.setText("/");
System.out.println("/ Div");
event.consume();
}
if (event.getCode() == KeyCode.MINUS || event.getCode() == KeyCode.SUBTRACT) {
field.setText("-");
System.out.println("- Minus");
}
switch (event.getCode()) {
case DIVIDE:
displayTextBottom.setText(event.getText());
break;
case SUBTRACT:
displayTextBottom.setText(event.getText());
break;
case ESCAPE:
displayTextBottom.setText("");
break;
case BACK_SPACE:
if (displayTextBottom.getText().length() > 0) {
StringBuilder removing = new StringBuilder(displayTextBottom.getText());
removing.deleteCharAt(displayTextBottom.getText().length() - 1);
String removed = removing.toString();
displayTextBottom.setText(removed);
setDisplayFontSizeBottom();
}
break;
default:
System.out.println("error");
}
}
选项在Windows上编译Caffe,但它失败并声明我需要使用Ninja。当我在配置文件(CMAKE_BUILD_SHARED_LIBS
)中将Ninja设置为1并运行脚本时,它会抱怨并提供以下错误消息:
build_win.cmd
我不知道为了获得成功的编译过程我还需要采取哪些其他步骤。我所做的就是下载Ninja,将其解压缩并将其添加到我的环境变量中。
我是否还需要安装gcc?
正如评论中所建议的那样,我查看了我的路径并注意到它配置不当。我修复了现在我遇到这些错误,似乎无法找到所需的库:
CMake Error: CMake was unable to find a build program corresponding to
"Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select
a different build tool. CMake Error: CMAKE_C_COMPILER not set, after
EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after
EnableLanguage
-- Configuring incomplete, errors occurred! ERROR: Configure failed
答案 0 :(得分:0)
我找到了原因。我在我的系统上安装了GCC,cmake
会尝试使用它而不是Visual C ++编译器
所需要的只是下载Ninja,将它放在你的Path Variable中你就可以了。你很高兴
更改build_win.cmd
中所需的设置以使用Ninja,您就完成了