【发布时间】:2016-01-13 11:27:27
【问题描述】:
问题
我有一些半年前的 c 程序正在研究,并希望我现在可以继续研究它们。在那之后我确实安装了 Windows 10(64 位),所以我认为这可能是一个问题,但从那时起这些程序就已经在 Windows 10 上运行了。
大约 2 个月前,我可以使用 make-file 构建并运行可执行文件,但是当我今天再次尝试时,在我看来可执行文件没有运行。我现在也尝试更新 cygwin 和(我认为)所有相关软件包。
如果 cygwin 有任何重要的更改,我已经用 Google 搜索过,但我并没有真正找到任何东西。
详情
当我尝试运行任何程序时,./executeables/helloworld.exe 行很长一段时间都没有任何反应,然后最终产生错误:
$ make 1
gcc 1-helloworld.c -o ./executeables/helloworld.exe -lncurses
./executeables/helloworld.exe
0 [sig] make 7332 get_proc_lock: Couldn't acquire sync_proc_subproc for(5, 1), last 7, Win32 error 0
1324 [sig] make 7332 proc_subproc: couldn't get proc lock. what 5, val 1
在此之后,什么都没有发生,我什至无法用ctrl+C 停止进程,所以我必须用任务管理器结束“make.exe”(奇怪的是它包含 2 个进程)。然后终端只说
makefile:2: recipe for target '1' failed
make: *** [1] Error 1
所以我猜想从 Windows 获取互斥锁或锁来创建进程存在问题,但我不知道为什么会发生这种情况。
代码
本次尝试中的示例将此代码用于 hello world 程序,但对于更复杂的程序也是如此。
#include <ncurses.h>
#include <string.h>
int main() {
char *message="Hello World";
int row,col;
int len = strlen(message);
initscr();
getmaxyx(stdscr, row, col); //screensize
mvprintw(row/2, (col-len)/2, "%s", message); //center of screen
getch();
refresh();
endwin();
return 0;
}
以前有人见过这个问题吗?
【问题讨论】:
标签: windows makefile cygwin ncurses