Lazarus cannot support Winsock lazarus / 34-Windows ---------------------------------------------------------------------- mlkj · 2012-09-19 05:42 uses  Lazarus 1.1  win64 fpc2.61 NO1: SetSockoPt function always returns an error NO2: successfully built  but  Debugger Error No3: Compile out application cannot run,  "Procedure entry point WSASocket could not be located in dll ws2_32.dll" I send you the code ---------------------------------------------------------------------- ludob · 2012-09-19 10:01 QuoteNo3: Compile out application cannot run,  "Procedure entry point WSASocket could not be located in dll ws2_32.dll"That is a known problem. A bug report is in the making. Use explicitly WSASocketA or WSASocketW. Using WSASocketA your iocpclient says Connection success and appends '错误' to the memo. QuoteNO1: SetSockoPt function always returns an error What is the error? Use WSAGetLastError to get a detailed error message. The program you attached is not complete. gsserver.lpr and gsdbos.pas are missing. I can't test anything myself. ---------------------------------------------------------------------- mlkj · 2012-09-19 12:14 WSASocketA, WSASocketW is to create can transmission ANSI character, socket unicode characters of two kinds of way, so use WSASocket, WSASocketA, WSASocketW are necessary to create You don't have to doubt my code, This code from DelphiXE2 transplantation come over, in the DelphiXE2 running well. I only know is Lazarus has a problem rather than my code has a problem,But Lazarus exactly is which place has a problem, I don't know,  Lazarus still need to try hard! ---------------------------------------------------------------------- taazz · 2012-09-19 12:47 Just a noob question Is ws2_32.dll a 32bit or 64bit dll? Doesn't lazarus 64bit create 64bit applications aka needs a 64bit dll to link to? ---------------------------------------------------------------------- ludob · 2012-09-19 13:30 QuoteYou don't have to doubt my codeI'm not saying that your code is wrong. There is a bug in the fpc winsock2.pp unit. WSASocket should be translated to WSASocketA or WSASocketW. The header translation should do this. The only problem I hadve with your code is the missing units. ---------------------------------------------------------------------- ludob · 2012-09-19 13:37 QuoteIs ws2_32.dll a 32bit or 64bit dll?On win64 you will find a 64 bit ws2_32.dll in windows\system32. The 32 bit version is in windows\SysWOW64. Logical, isn't it? ---------------------------------------------------------------------- mlkj · 2012-09-19 13:39 My system is Win7 64 bit ws2_32. DLL is Windows own What I say very clearly Use delphiXE2 compiler can normal operation ---------------------------------------------------------------------- ludob · 2012-09-19 13:45 QuoteWhat I say very clearly Use delphiXE2 compiler can normal operationPerhaps we are having a language problem. Are you asking for some help to get your code working with Lazarus or are you just stating that your code works with XE2 in which case I'll leave you to it. Your server project is not complete, I can't event try it with XE2. ---------------------------------------------------------------------- mlkj · 2012-09-19 14:04 Use Lazarus and Delphi call  winSock2 API is basically the same