C:\Users\Eric\Desktop\sad\Makefile.win [Build Error] ["sample] Error 1
Main.cpp
- //Main.cpp
- #include <iostream>
- #include "Socket.h"
- using namespace std;
- int main()
- {
- int choice;
- int port = 666;
- //char *ipAddress = "127.0.0.1";
- string ipAddress;
- bool done = false;
- char recMessage[STRLEN];
- char sendMessage[STRLEN];
- cout<<"1) Host server"<<endl;
- cout<<"2) Join server"<<endl;
- cout<<"3) Quit"<<endl;
- cin>>choice;
- if ( choice == 3 )
- exit(0);
- else if ( choice == 2 )
- {
- //Client
- cout<<"Enter an IP address, 127.0.0.1 is the loopback address"<<endl;
- cin>>ipAddress;
- ClientSocket sockClient;
- cout<<"ATTEMPTING TO CONNECT..."<<endl;
- sockClient.ConnectToServer( ipAddress.c_str(), port );
- //Connected
- while ( !done )
- {
- sockClient.GetAndSendMessage();
- cout<<"\t--WAIT--"<<endl;
- sockClient.RecvData( recMessage, STRLEN );
- cout<<"Recv > "<<recMessage<<endl;
- if ( strcmp( recMessage, "end" ) == 0 ||
- strcmp( sendMessage, "end" ) == 0 )
- {
- done = true;
- }
- }
- sockClient.CloseConnection();
- }
- else if ( choice == 1 )
- {
- //SERVER
- ServerSocket sockServer;
- cout<<"HOSTING..."<<endl;
- sockServer.StartHosting( port );
- //Connected
- while ( !done )
- {
- cout<<"\t--WAIT--"<<endl;
- sockServer.RecvData( recMessage, STRLEN );
- cout<<"Recv > "<<recMessage<<endl;
- sockServer.GetAndSendMessage();
- if ( strcmp( recMessage, "end" ) == 0 ||
- strcmp( sendMessage, "end" ) == 0 )
- {
- done = true;
- }
- }
- }
- }
- Make File
- # Project: asdf
- # Makefile created by Dev-C++ 4.9.9.2
- CPP = g++.exe -D__DEBUG__
- CC = gcc.exe -D__DEBUG__
- WINDRES = windres.exe
- RES =
- OBJ = main.o Socket.o $(RES)
- LINKOBJ = main.o Socket.o $(RES)
- LIBS = -L"lib" ../../../../0Apps/DevCPP/lib/libws2_32.a -g3
- INCS = -I"include"
- CXXINCS = -I"lib/gcc/mingw32/3.4.2/include" -I"include/c++/3.4.2/backward" -I"include/c++/3.4.2/mingw32" -I"include/c++/3.4.2" -I"include"
- BIN = "sample program.exe"
- CXXFLAGS = $(CXXINCS) -g3
- CFLAGS = $(INCS) -g3
- RM = rm -f
- .PHONY: all all-before all-after clean clean-custom
- all: all-before "sample program.exe" all-after
- clean: clean-custom
- ${RM} $(OBJ) $(BIN)
- $(BIN): $(OBJ)
- $(CPP) $(LINKOBJ) -o "sample program.exe" $(LIBS)
- main.o: main.cpp
- $(CPP) -c main.cpp -o main.o $(CXXFLAGS)
- Socket.o: Socket.cpp
- $(CPP) -c Socket.cpp -o Socket.o $(CXXFLAGS)




