Winsock is missing initialization.
#ifdef _WIN32
// Initialize Winsock
WSADATA wsaData;
int iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
if (iResult != 0)
{
LOG_ERROR("Error initializing socket (WSAStartup failed: %d)", iResult);
return ERROR_FAIL;
}
#endif
Regards,
Pawel
You can close/delete this ticket. No one probably except me can see this problem as I am using stlink backend from openocd as my library. In openocd winsock initialisation is present in serverhostosentry();
I've never investigated using openocd as library
The file main.c should be skipped; the entry point of the library libopenocd.a should be openocd_main(), that includes the call to server_host_os_entry().
If you decide to not call openocd_main() and to call lowest level functions, you should take care of the dependencies.
Do I miss something?
The call to server_host_os_entry() has been moved in http://openocd.zylin.com/5456 as part of the effort for stlink tcp server.
Sorry, but I was too much "trigger happy" with this issue. Unfortunately it is not github and I can't see an option to delete this issue.
No problem. Closed!