Link to home
Start Free TrialLog in
Avatar of zhshqzyc
zhshqzyc

asked on

incompatible implicit declaration of built-in function âexitâ

Hi,

I downloaded a software at here and followed the instructions in readme file.
I made a compile version of msa but it seemed failure in Linux Fedora 14.
make msa

Open in new window

Got a warning
incompatible implicit declaration of built-in function âexitâ

Open in new window


Could you please take a look?
Thanks.
Avatar of Bryan Butler
Bryan Butler
Flag of United States of America image

#include <stdlib.h>

This is missing or something else is wrong.  Edit the file giving problems and add it at the top if it's not there already.  Or disable the warning with "-fno-builtin-exit" compiler option.  Fixing it would be the thing to do though.
Avatar of evilrix
At a guess I would say the source code that is calling the standard exit function is missing the include stdlib.h
http://www.cplusplus.com/reference/clibrary/cstdlib/exit/

It is called in both main.c and ecalc.c and I see no way stdlib.h is included in either. Note, I have not tried to build this but this would be the first thing I would check. Try adding #include <stdlib.h> at the top of these files just under the inclusion of stdio.h and see if that helps.
Oooh, sorry developedtester -- seems you are typing a little faster than me today :)
Avatar of zhshqzyc
zhshqzyc

ASKER

I added it. However
-bash-4.1$ make msa
cc -O -c main.c 
main.c: In function âdataâ:
main.c:331:3: warning: incompatible implicit declaration of built-in function âstrcpyâ
main.c: In function âgetseqâ:
main.c:620:5: warning: incompatible implicit declaration of built-in function âstrlenâ
main.c:630:21: warning: incompatible implicit declaration of built-in function âstrlenâ
main.c: In function âallocâ:
main.c:1395:8: error: conflicting types for âmallocâ
make: *** [main.o] Error 1

Open in new window

main.c is attached.
main.c
Add string.h
Now
-bash-4.1$ make msa
cc -O -c main.c 
main.c: In function âallocâ:
main.c:1395:8: error: conflicting types for âmallocâ
make: *** [main.o] Error 1

Open in new window

line 1395 is
 char	*malloc();

Open in new window

Ok, you may also need malloc.h :)
Still wrong even added it.
Hmmm. There isn't a great deal about that specific error but one thing to try adding the compile time flag --without-gnu-malloc
>> try adding the compile time flag --without-gnu-malloc
http://www.gnu.org/s/hello/manual/gnulib/malloc.html
-bash-4.1$ make msa  --without-gnu-malloc 
make: unrecognized option '--without-gnu-malloc'

Open in new window

Is it?
Hmmm. Ok, I need to try building this myself but I'm not in a position to do that right this minute. I'll take a look in a bit and get back to you.
ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks.