   strange problom in c
  hello all.i'm using Visual Studio 2005 - Visual c++.i tried to use a tutorial i found about winsockbut for some reason my visual c++ dont want to compile it..well here is the error:Compiling manifest to resources...Linking...MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartupC:\newproject\winsoc\Debug\winsoc.exe : fatal error LNK1120: 1 unresolved externalsBuild log was saved at "file://c:\newproject\winsoc\winsoc\Debug\BuildLog.htm"winsoc - 2 error(s), 0 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========and here is the code:#pragma comment(lib, "WS2_32.lib")#include <stdio.h>#include <winsock.h>int main(){ WSADATA wsa; WORD ver = MAKEWORD(1,1); SOCKET sock; WSAStartup(ver, &wsa);  sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if(sock < 0) { printf("Sock creation faild") ;  return 0; }  int operation; SOCKADDR_IN address; address.sin_family = AF_INET; address.sin_port = htons(80); address.sin_addr.s_addr = inet_addr("216.239.37.99");  operation = connect(sock, (SOCKADDR*)&address, sizeof(address)); if(operation == SOCKET_ERROR) {  printf("failed to connect");  return 0; }  printf("connection established to 216.239.37.99! sending simple hellow message\n"); char buffer[20] = "Hi Google"; operation = send(sock, buffer, sizeof(buffer), 0); if(operation < 0) {  printf("failed to send buffer");  return 0; } printf("done, disconnecting and cleaning up") ; WSACleanup(); return 1;}anyone has any idea why this isnt working and how to fix it?thanks in advance   
  You created a Win32 application instead of a console application. You can either re-create the project, or go to project settings -> linker (I think) and change the subsystem from "WINDOWS" to "CONSOLE".Win32 applications use WinMain(), console ones use main(). Your code supplies main(), but the compiler is looking for WinMain().   ;  thanks it helped.but now when i compile it doesnt create an exe file.any idea how to create it?thanks in advance   ;Quote:Original post by mc30900thanks it helped.but now when i compile it doesnt create an exe file.any idea how to create it?thanks in advanceWhat does it create then? A DLL? A .lib? What's the output in the compile window? Does it give you a "Linking..." stage?   ;  If the compilation succeeded without errors, then you will get an executable. Look again. Did you check the Release and/or Debug subdirectories?   ;  it creates:mt.depnewwindosck.exe.embed.manifest.resnewwindosck.exe.embed.manifestnewwindosck.exe.intermediate.manifestthewins.objvc80.idbvc80.pdbhow can someone that doesnt have vc++ run it?thanks in advance   ;  Are you sure there are no compilation errors?   ;Quote:Original post by mc30900it creates:Wrong directory.  Please navigate to your solution directory (containing the project directory that contains the Debug/Release folder you are in) and see the release and debug folders in that directory for your .exe.   ;Quote:Original post by MaulingMonkeyQuote:Original post by mc30900it creates:Wrong directory.  Please navigate to your solution directory (containing the project directory that contains the Debug/Release folder you are in) and see the release and debug folders in that directory for your .exe.lol! thanks matedidnt pay attention :)   