Sponsored Content
Full Discussion: Compilation C program
Top Forums Programming Compilation C program Post 302588112 by lordtrex on Friday 6th of January 2012 05:58:31 PM
Old 01-06-2012
Compilation C program

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.
Code:
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
Code:
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:
Code:
#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

 

10 More Discussions You Might Find Interesting

1. Programming

compilation error

Hi, While trying compile a C++ file in UNIX with gcc whose make rule involves the usage of /usr/ccs/bin/as, I get the following error: /usr/ccs/bin/as: No such file or directory /usr/ccs/bin/as: error: write error on output file "<filename>.o" *** Error code 1 clearmake: Error: Build... (2 Replies)
Discussion started by: smanu
2 Replies

2. UNIX for Dummies Questions & Answers

Kernel compilation

I have re-compiled kernel source code available in /usr/src/linux.2.4.20 with "make" command. The compilation is succesful. Now the problem is create the image for this. The documentation in the same folder says that now you have compile "make image". There is no option for image in Makefile. ... (3 Replies)
Discussion started by: mankrish
3 Replies

3. UNIX for Dummies Questions & Answers

multifile c program compilation and execution

i am using unix os and my program is divided in two text files .:):) how to compile and make one executable file, using unix command. (1 Reply)
Discussion started by: alokmishra8
1 Replies

4. UNIX for Dummies Questions & Answers

Compilation program

Hi, I'm new to HP-Unix programming; I have a few programs, don't know the programming language used. I have to make minor changes and to recompile the source code. How do I find the programming language used and the compiler? Thanks, Nick. (3 Replies)
Discussion started by: NicoMan
3 Replies

5. UNIX for Dummies Questions & Answers

Script to open program and send/execute command in program

Hi, i want to write a script that executes a program (exec?) . this program then requires a filename as input. how do i give it this input in the script so the program will be complete run and close by the script. e.g. exec prog.exe program then asks for filename "enter filename:"... (1 Reply)
Discussion started by: tuathan
1 Replies

6. UNIX for Dummies Questions & Answers

Compilation

Hi All, We have a C program existing in one of the folders which I have to modify a lil bit, When I'm trying to compile the program using GCC or CC command its showing as ksh: gcc: not found is that mean there is no compiler or do I have to verify for something, please advice Thank... (2 Replies)
Discussion started by: diggermf
2 Replies

7. Programming

Program exited with code 01: does it indicate unsuccessful compilation?

(gdb) r --------------------- enter Breakpoint 1, 0x0000000000409d40 in main () (gdb) n Single stepping until exit from function main, which has no line number information. Find_Cmd_Option: found option no. 2: seed (s) Find_Cmd_Option: found option no. 5: dfile (c) Initial no. div... (1 Reply)
Discussion started by: cdbug
1 Replies

8. AIX

Problem in compilation.

Hi, I am executing the below mentioned code:- proc SQLCHECK=SEMANTICS iname=CDBInteractor.pc parse=none code=cpp cpp_suffix=cpp g++ -c main.cpp g++ -o pre_request_engine main.o -I/oracle/oracle/app/product/10g/precomp -L/oracle/oracle/app/product/10g/lib32 -lnsl -ldl And... (2 Replies)
Discussion started by: tushar_tus
2 Replies

9. UNIX for Dummies Questions & Answers

proc program compilation in unix

hi, i need to compile a proc program, say prog.pc can we compile this program in the unix environment? does this need a make file? can anyone help me on this since i am new to this area. Thanks in advance. (1 Reply)
Discussion started by: csprog
1 Replies

10. Shell Programming and Scripting

Compilation

Hi All, Do we have a way to compile a shell program? I am using ksh/bash/sh and not CSH. Cheers Ravi (12 Replies)
Discussion started by: panyam
12 Replies
sdl-config(1)						      General Commands Manual						     sdl-config(1)

NAME
sdl-config - script to get information about the installed version of SDL SYNOPSIS
sdl-config [ --prefix[=DIR] ] [ --exec-prefix[=DIR] ] [ --version ] [ --cflags ] [ --libs ] [ --static-libs ] DESCRIPTION
sdl-config is a tool that is used to configure and determine the compiler and linker flags that should be used to compile and link pro- grams, and libraries, and plugins that use SDL. It is also used internally by the m4 macros that are included with SDL. OPTIONS
--cflags Print the compiler flags that are necessary to compile a program or library that uses SDL. --exec-prefix=DIR If specified, use DIR instead of the installation exec prefix that SDL was build with when computing the output for the --exec-pre- fix option. This option must be specified before any of the --cflags, and --libs options. --libs Print the linker flags that are necessary to link a program that uses SDL. --prefix=DIR If specified, use DIR instead of the installation prefix that SDL was built with when computing the output for the --prefix, and --exec-prefix options. This option is also used for the exec prefix if --exec-prefix was not specified. This option must be speci- fied before any of the --cflags, and --libs options. --static-libs Print the linker flags that are necessary to statically link a program that uses SDL. --version Prints the currently installed version of SDL on standard output. EXAMPLES
gcc -o main.o $(sdl-config --cflags) main.c is how you might use sdl-config to compile a C source file for an executable program. gcc -o my_app $(sdl-config --libs) main.o util.o is how you might use sdl-config to link compiled objects into an executable program. AUTHOR
The Simple DirectMedia Layer (SDL) library was written by Sam Lantinga. This manual page was written by Branden Robinson, originally for Progeny Linux Systems, Inc., and the Debian Project. This manual page was modified by Petr Pisar to match original SDL distribution. SDL 1.2 2013-06-19 sdl-config(1)
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy