   Weird errors that just don't make sense.
  Ok, for some reason, i'm getting these errors:1>c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(6) : error C2146: syntax error : missing ';' before identifier 'Winsock'1>c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(6) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int1>c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(6) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int1>c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(12) : error C3861: 'WSAStartup': identifier not found1>c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(12) : error C3861: 'MAKEWORD': identifier not found1>c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(14) : error C2228: left of '.wVersion' must have class/struct/union1>   type is 'int'2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(9) : error C2146: syntax error : missing ';' before identifier 'Winsock'2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(9) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(9) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(10) : error C2146: syntax error : missing ';' before identifier 'Socket'2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(10) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(10) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(11) : error C2146: syntax error : missing ';' before identifier 'ServerAddres'2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(11) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(11) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(17) : error C3861: 'WSAStartup': identifier not found2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(17) : error C3861: 'MAKEWORD': identifier not found2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(19) : error C2228: left of '.wVersion' must have class/struct/union2>   type is 'int'1>c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(14) : error C2228: left of '.wVersion' must have class/struct/union2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(19) : error C2228: left of '.wVersion' must have class/struct/union1>   type is 'int'2>   type is 'int'2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(19) : error C3861: 'LOBYTE': identifier not found1>c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(14) : error C3861: 'LOBYTE': identifier not found2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(19) : error C3861: 'HIBYTE': identifier not found1>c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(14) : error C3861: 'HIBYTE': identifier not found2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(21) : error C3861: 'WSACleanup': identifier not found1>c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(16) : error C3861: 'WSACleanup': identifier not found2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(22) : error C2561: 'wmain' : function must return a value1>c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(17) : error C2561: 'wmain' : function must return a value2>   c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(15) : see declaration of 'wmain'1>   c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(10) : see declaration of 'wmain'1>c:\users\rosario\documents\visual studio 2008\projects\server\server\server.cpp(21) : error C3861: 'WSACleanup': identifier not found2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(24) : error C2065: 'AF_INET' : undeclared identifier2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(24) : error C2065: 'SOCK_DGRAM' : undeclared identifier2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(24) : error C2065: 'IPPROTO_UDP' : undeclared identifier1>Build log was saved at "file://c:\Users\Rosario\Documents\Visual Studio 2008\Projects\Server\Server\Debug\BuildLog.htm"2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(24) : error C3861: 'socket': identifier not found2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(26) : error C3861: 'ZeroMemory': identifier not found2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(27) : error C2228: left of '.sin_family' must have class/struct/union2>   type is 'int'1>Server - 12 error(s), 0 warning(s)2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(27) : error C2065: 'AF_INET' : undeclared identifier2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(28) : error C2228: left of '.sin_addr' must have class/struct/union2>   type is 'int'2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(28) : error C2228: left of '.s_addr' must have class/struct/union2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(28) : error C3861: 'inet_addr': identifier not found2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(29) : error C2228: left of '.sin_port' must have class/struct/union2>   type is 'int'2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(35) : error C2065: 'sockaddr' : undeclared identifier2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(35) : error C2059: syntax error : ')'2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(37) : error C2137: empty character constant2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(35) : error C3861: 'sendto': identifier not found2>c:\users\rosario\documents\visual studio 2008\projects\server\cleint\client.cpp(40) : error C3861: 'WSACleanup': identifier not foundand i included the header file and the lib file, so anything i can do rather then start the project all over?   
  You might want to consider posting the code that's giving the errors.   ;  You need to include winsock2.h.EDIT: Oops, missed the last line saying you already did. You may want to check the order of your includes, as some will conflict with Winsock. In particular, are you including MySQL headers?   ;  And you need to include it before windows.h.   ;Quote:Original post by EnerjakOk, for some reasonBecause there's something wrong with the code. But we can't see the code, and we're not psychic. Please show us what the complained-about lines look like, at least. A little surrounding context might be a good idea too.;  thing is, i'm using a console window and it's only in this project i'm getting these errors not in my other project i'm using winsock in. so, i don't really get what's wrote since it works in another project...EDIT: here is my code for the server/client:#include "stdafx.h"#define SERVER_ADDRESS "192.168.1.100"#define SERVER_PORT  17000WSADATA Winsock;SOCKET Socket;sockaddr_in ServerAddres;char Buffer[16];int _tmain(int argc, _TCHAR* argv[]){WSAStartup(MAKEWORD(2,2),&Winsock);if(LOBYTE(Winsock.wVersion)!=2 || HIBYTE(Winsock.wVersion)!=2){WSACleanup();return;}Socket = socket(AF_INET, SOCK_DGRAM,IPPROTO_UDP);ZeroMemory(&ServerAddres,sizeof(ServerAddres));ServerAddres.sin_family = AF_INET;ServerAddres.sin_addr.s_addr = inet_addr(SERVER_ADDRESS);ServerAddres.sin_port = SERVER_PORT;while(true){gets(Buffer);sendto(Socket,Buffer,16,0,(sockaddr*)&ServerAddres,sizeof(sockaddr));if(Buffer[0] == ' ')break;}WSACleanup();return 0;}the server:#include "stdafx.h"WSADATA Winsock;int _tmain(int argc, _TCHAR* argv[]){WSAStartup(MAKEWORD(2,2),&Winsock);if(LOBYTE(Winsock.wVersion) != 2 || HIBYTE(Winsock.wVersion)!=2){WSACleanup();return;}WSACleanup();return 0;}as u can see, my code is pretty straight forward, so other then this, i don't know what to show you.   ;Quote:Original post by Enerjakthing is, i'm using a console window and it's only in this project i'm getting these errors not in my other project i'm using winsock in. so, i don't really get what's wrote since it works in another project...Well, what are the differences between the two projects? If it was only the entry point (main() vs WinMain()) then it'd work fine - so there's obviously something else changed.As Zahlman said, we need to see code - all I can tell you from the errors you posted is that the compiler doesn't have a clue what your Winsock class / struct is, probably because you've not included the header that declares the class (And presumably includes windows.h and winsock.h).   ;  And are the stdafx.h headers identical for both projects?   ;  yes, and yo prove it i'll post the contents for both files.the Server's #pragma once#include "targetver.h"#define _WINSOCK2API_#include <WinSock2.h>#include <stdio.h>#include <tchar.h>#pragma comment(lib,"Ws2_32.lib")the client's#pragma once#include "targetver.h"#define _WINSOCK2API_#include <WinSock2.h>#include <stdio.h>#include <tchar.h>#pragma comment(lib,"Ws2_32.lib")as you can see, they are the same. i am including the winsock API header file and pragma commenting the lib so that i got it where i need it. other then this, i can't give anything else as information on what i'm doing.;  Why are you #defining _WINSOCK2API_?   