每当我尝试更新我的 EC2 实例时,都会收到以下错误:
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00:00
amzn-updates | 2.5 kB 00:00:00
817 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package aws-cfn-bootstrap.noarch 0:1.4-30.21.amzn1 will be updated
---> Package aws-cfn-bootstrap.noarch 0:1.4-31.22.amzn1 will be an update
---> Package curl.x86_64 0:7.53.1-16.85.amzn1 will be updated
---> Package curl.x86_64 0:7.53.1-16.86.amzn1 will be an update
---> Package db4.x86_64 0:4.7.25-18.11.amzn1 will be obsoleted
--> Processing Dependency: libdb-4.7.so()(64bit) for package: rpm-libs-4.11.3-21.75.amzn1.x86_64
--> Processing Dependency: libdb-4.7.so()(64bit) …Run Code Online (Sandbox Code Playgroud) 我认为问题在于我没有使用./a.out而不是./filename,但事实并非如此.
这是我编译程序的方式:
g++ -o -Wall -pthread filename.cpp
Run Code Online (Sandbox Code Playgroud)
运行:
./filename
Run Code Online (Sandbox Code Playgroud)
我认为运行pthread程序与运行标准c ++程序不同,但事实并非如此.
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
struct argStruct {
int arg1;
int arg2;
};
void *sum(void *arguments) {
struct argStruct *args = (struct argStruct *)arguments;
int a = args -> arg1;
int b = args -> arg2;
int c = a + b;
printf("%d + %d = %d ",a,b,c);
pthread_exit(NULL);
}
int main() {
pthread_t thr1, thr2;
struct argStruct args;
args.arg1 = 3;
args.arg2 = 10;
int …Run Code Online (Sandbox Code Playgroud)