这是一个通用的问题,以帮助有程序问题的新程序员,但不知道如何使用调试器来诊断问题的原因.
这个问题涉及两类更具体的问题:
[What is a debugger and how can it help me diagnose problems?](https://stackoverflow.com/q/25385173)
我使用以下代码成功地使用 C 和 libcurl 发出了 json-rpc 请求
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
void post_rpc(CURL *curl_handle)
{
CURLcode res;
char JSONRPC_BASE_URL[] = "https://api.betfair.com/exchange/betting/json-rpc/v1";
char rpc_request[]="{\"jsonrpc\": \"2.0\", \"method\": \"SportsAPING/v1.0/listEventTypes\", \"params\": {\"filter\":{ }}, \"id\": 1}";
char session_token[]= "MY_ACTIVE_SESSION_STRING";
char session_header[100+sizeof(session_token)];
strcpy(session_header, "X-Authentication:");
strcat(session_header, session_token);
struct curl_slist * headers = NULL;
headers = curl_slist_append(headers, "X-Application: MY_API_KEY");
headers = curl_slist_append(headers, session_header);
headers = curl_slist_append(headers, "content-type : application/json");
/* init the curl session */
curl_handle = curl_easy_init();
/* HEADERS */
curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headers); …Run Code Online (Sandbox Code Playgroud) 我正在尝试从 pi 的远程访问组中调试我使用 MPI 编写的代码。我无法直接访问 Pi 以便能够使用 GUI 来调试代码。
我已经尝试过使用此问题中显示的类似屏幕,但每当我尝试使用屏幕时,我都会收到以下消息:
There are not enough slots available in the system to satisfy the 2 slots
that were requested by the application:
screen
Either request fewer slots for your application, or make more slots available
for use.
Run Code Online (Sandbox Code Playgroud)
如果我尝试告诉它只使用 1 个屏幕,mpiexec 会失败
mpiexec -N 16 --host 10.0.0.3 -np 1 screen -oversubscribe batSRTest3 shortpass.bat
--------------------------------------------------------------------------
mpiexec was unable to find the specified executable file, and therefore
did not launch the job. This error …Run Code Online (Sandbox Code Playgroud)