Cygwin,编译时 make "couldn't get proc lock" 错误和 C 程序 运行
Cygwin, error for make "couldn't get proc lock" when compiling and running a C program
问题
我有一些已经使用了半年的 C 程序,我希望现在可以继续使用它们。在那之后我确实安装了 windows 10(64 位),所以我认为这可能是个问题,但从那时起程序在 windows 10 上有 运行。
大约 2 个月前,我可以使用 make 文件和 运行 可执行文件来构建,但是当我今天再次尝试时,在我看来可执行文件不是 运行ning。我现在也尝试更新 cygwin 和(我认为)所有相关包。
如果 cygwin 有任何重要的变化,我已经用谷歌搜索过,但我没有真正找到任何东西。
详情
当我尝试 运行 任何程序时,在 ./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 获取互斥锁或锁以创建进程时存在问题,但我不知道为什么会发生这种情况。
代码
此 try 中的示例将此代码用于 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;
}
以前有人遇到过这个问题吗?
Avast 杀毒软件 阻止了程序 运行 正确运行。禁用它使一切 运行 变得完美。我终于在这个帖子中找到了答案:
Netbeans 8.1 IDE compiles and builds C programs but does not show their output
注:
由于它没有被标记为该线程中问题的答案,并且因为该问题没有明确关注相同的错误(尽管存在相同的错误),我将保留我的问题而不是将其标记为重复。
感谢 Sheshadri Iyengar 提供解决方案。
问题
我有一些已经使用了半年的 C 程序,我希望现在可以继续使用它们。在那之后我确实安装了 windows 10(64 位),所以我认为这可能是个问题,但从那时起程序在 windows 10 上有 运行。
大约 2 个月前,我可以使用 make 文件和 运行 可执行文件来构建,但是当我今天再次尝试时,在我看来可执行文件不是 运行ning。我现在也尝试更新 cygwin 和(我认为)所有相关包。
如果 cygwin 有任何重要的变化,我已经用谷歌搜索过,但我没有真正找到任何东西。
详情
当我尝试 运行 任何程序时,在 ./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 获取互斥锁或锁以创建进程时存在问题,但我不知道为什么会发生这种情况。
代码
此 try 中的示例将此代码用于 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;
}
以前有人遇到过这个问题吗?
Avast 杀毒软件 阻止了程序 运行 正确运行。禁用它使一切 运行 变得完美。我终于在这个帖子中找到了答案:
Netbeans 8.1 IDE compiles and builds C programs but does not show their output
注: 由于它没有被标记为该线程中问题的答案,并且因为该问题没有明确关注相同的错误(尽管存在相同的错误),我将保留我的问题而不是将其标记为重复。
感谢 Sheshadri Iyengar 提供解决方案。