Hi guys...
Im trying to compile a program written in C..
I am able to compile it to X86, especifically Ubuntu..
But i cant compile it to mips ar71xx architecture..
im using mips-linux-uclibc-gcc cross compiler.
this is the portion of code:
//STAT: LOGIN INFO
// 3. login info
i = cs_message_receive(sock, &clicd, buf, sessionkey);
ticks = GetTickCount()-ticks;
if (i<=0) {
close(sock);
if (tid) pthread_join(tid, NULL);
pthread_exit();
}
if (buf[0]!=MSG_CLIENT_2_SERVER_LOGIN) {
close(sock);
if (tid) pthread_join(tid, NULL);
pthread_exit();
}
index = 3;
// Check username
struct twin_client_data *usr = cfg.client;
int found = 0;
while (usr) {
if (!strcmp(usr->user,&buf[index])) {
found=1;
break;
}
usr = usr->next;
}
if (!found) {
buf[0] = MSG_CLIENT_2_SERVER_LOGIN_NAK;
buf[1] = 0;
buf[2] = 0;
cs_message_send(sock, NULL, buf, 3, sessionkey);
debug("newcamd: unknown user '%s' (%s)\n", &buf[3], ip2string(ip));
close(sock);
if (tid) pthread_join(tid, NULL);
pthread_exit();
}
i get this error when compiling on uclibc
mips-linux-uclibc-gcc -c -O2 -I. main.c -o main.o
<built-in>:0: note: someone does not honour COPTS correctly, passed 0 times
main.c: In function 'th_cs_connect_cli':
main.c:196: error: too few arguments to function 'pthread_exit'
main.c:201: error: too few arguments to function 'pthread_exit'
main.c:222: error: too few arguments to function 'pthread_exit'
main.c:257: error: too few arguments to function 'pthread_exit'
make[4]: *** [main.o] Error 1
the line 196 correspond to the first pthread_exit() funtion that appears in the code.
Im not very familiar with C programming..
I also waas reading the pthread_exit() usage and i could not clear my doubts..
This is my makefile file:
#CC = gcc
CXX = g++
STRIP = strip
CFLAGS = -O2 -I.
LFLAGS = -pthread
OBJECTS = tools.o convert.o debug.o des.o md5crypt.o sockets.o serial.o newcamd.o config.o threads.o main.o
link : $(OBJECTS)
$(CC) $(LFLAGS) -o twin2cs $(OBJECTS)
.c.o:
$(CC) -c $(CFLAGS) $< -o $@
clean:
-rm *.o