WHY?
I write program with Qt Designer
file server.ui.h:
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
void server:
bListening_clicked()
{
int server_sockfd, client_sockfd;
int server_len, client_len;
struct sockaddr_in server_address;
struct sockaddr_in client_address;
server_sockfd = socket(AF_INET, SOCK_STREAM, 0);
server_address.sin_family = AF_INET;
server_address.sin_addr.s_addr = htonl(INADDR_ANY);
server_address.sin_port = htons(9734);
server_len = sizeof(server_address);
bind(server_sockfd,(struct sockaddr*)&server_address, server_len);
listen(server_sockfd, 5);
client_sockfd = accept(server_sockfd,(struct sockaddr *)&client_address, &client_len);
}
#qmake server.pro
#make
Error:
g++ -c -pipe -Wall -W -O2 -march=i386 -mcpu=i686 -g -DGLX_GLXEXT_LEGACY -fno-use-cxa-atexit -fno-exceptions -DQT_NO_DEBUG -I/usr/lib/qt-3.1/mkspecs/default -I. -I/usr/lib/qt-3.1/include -I.ui/ -I.moc/ -o .obj/server.o .ui/server.cpp
In file included from .ui/server.cpp:22:
server.ui.h: In member function `virtual void Server:
bListen_clicked()':
server.ui.h:30: no matching function for call to `Server::accept(int&,
sockaddr*, int*)'
/usr/lib/qt-3.1/include/qdialog.h:93: candidates are: virtual void
QDialog::accept()
make: *** [.obj/server.o] Error 1.