I'm doing some college work, and i came across this error when i compile:
1 2 3 4 5 6 7 8 9 10
g++ *.cpp -lpthread
In file included from Packet.cpp:2:
/usr/include/sys/socket.h:26: error: expected unqualified-id before string constant
In file included from ServerMain.cpp:3:
/usr/include/sys/socket.h:26: error: expected unqualified-id before string constant
In file included from ThreadData.cpp:2:
/usr/include/sys/socket.h:26: error: expected unqualified-id before string constant
I tried compiling with -lsocket and nothing changed.
ServerMain.cpp
has this include:
1 2 3 4 5
#include <pthread.h>
#include "typedefs.h"
#include <sys/socket.h> /* API para sockets */
#include <arpa/inet.h> /* Estrutura sockaddr */
#include <stdio.h>