#include<iostream>
#include<snap7.h>
#pragma comment(lib,"snap7.lib")
using namespace std;
const char* plc_ip = "192.168.2.1";
int main() {
TS7Client *client = new TS7Client();
int ret = client->ConnectTo(plc_ip,1,0);
if (ret != 0) {
cout << ret;
return -1;
}
return 0;
}
出现的错误如下