From: <joe...@ya...> - 2002-09-20 09:02:03
|
Hi, the attached code saved as 'simple.c' and compiled with gcc 2.95.3-6 and mingw-runtime 2.0 as $ gcc simple.c -lwsock32 -mwindows -o simple.exe doesn't run on WindowsNT SP6a. This is due to the fact that the procedure entry point for symbol 'WSAFDIsSet' can't be found. Strange, since gethostbyname doesn't cause any problems. If you comment the FD_ISSET line, the executable runs. Can someone reproduce this problem with symbol '__WSAFDIsSet'? If yes, can some recommend a way to solve this problem? Thanks in advance, Jörg ---------------------------------------------------------------- #include <winsock2.h> #include <windows.h> const char g_szClassName[] = "myWindowClass"; LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { int osfd = 0, ex; if (gethostbyname("asff")==0) {} if (FD_ISSET((SOCKET)osfd, &ex)) { } switch(msg) { case WM_CLOSE: DestroyWindow(hwnd); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } return 0; } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { WNDCLASSEX wc; HWND hwnd; MSG Msg; wc.cbSize = sizeof(WNDCLASSEX); wc.style = 0; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.lpszMenuName = NULL; wc.lpszClassName = g_szClassName; wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); RegisterClassEx(&wc); hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, g_szClassName, "The title of my window", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 240, 120, NULL, NULL, hInstance, NULL); ShowWindow(hwnd, nCmdShow); UpdateWindow(hwnd); while(GetMessage(&Msg, NULL, 0, 0) > 0) { TranslateMessage(&Msg); DispatchMessage(&Msg); } return Msg.wParam; } __________________________________________________________________ Gesendet von Yahoo! Mail - http://mail.yahoo.de Möchten Sie mit einem Gruß antworten? http://grusskarten.yahoo.de |