未加载wkernalbase.pdb报错
来源:3-4 信号的发送与处理

为offer而生
2020-10-23
在windows vs2019环境下运行以下程序时,按ctrl+c时直接报错
#include <iostream>
#include <signal.h>
#include <windows.h>
using namespace std;
void signalHandler(int signum)
{
cout << "Interrupt signal (" << signum << ") received.\n";
// 清理并关闭
//终止程序
exit(signum);
}
int main()
{
// 注册信号 SIGINT 和信号处理程序
signal(SIGINT, signalHandler);//ctr+c输入该信号
while (1) {
cout << "Going to sleep...." << endl;
Sleep(1000);
}
return 0;
}
写回答
1回答
-
李超
2020-10-24
课程中的程序要在linux 或mac 下执行,没有一家正常的公司会使用windows 做服务器,如果没有linux 实体机你就装个虚拟机做实验
012020-10-25
相似问题