尝试让getch()工作以捕获按键。
#include <curses.h>
...
...
WINDOW *w;
char f;
w = initscr();
timeout(3000);
f = getch();
endwin();
给了我以下错误: -
undefined reference to `wgetch'
undefined reference to `stdscr'
答案 0 :(得分:16)
这是一个链接错误。您是否正确链接到curses库?
在C中使用库有两个步骤。
#include
源文件中的相关头文件。这样您的代码就知道库函数的签名是什么。所以你正确地做到了这一点。-lncurses
添加到编译行应该这样做。这是一个explanation of linking。答案 1 :(得分:0)
以上答案正确无误,但格式为:
@Entity
@Table(name = "MenuChild")
public class MenuChildEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@Column(name = "parentId", nullable = false,insertable = false,updatable = false)
private String parentId;
private String childMenuName;
private String url;
private String status;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "MenuChild")
private Set<MenuRightEntity> menuRightEntities;
@ManyToOne
@JoinColumn(name = "parentId")
private MenuNameEntity MenuName;
//getter and setter
}
当我这样做时:
@Entity
@Table(name = "MenuRight")
public class MenuRightEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
private String companyId;
private String userId;
@Column(name = "url", nullable = false,insertable = false,updatable = false)
private String url;
private String status;
private String enqMode;
private String insertMode;
private String updateMode;
private String deleteMode;
@ManyToOne
@JoinColumn(name = "url")
private MenuChildEntity MenuChild;
//getter and setter
}
它没有起作用,因此显然应该将其解决。