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.
Could you please take a look?
Thanks.
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
Got a warningincompatible implicit declaration of built-in function âexitâ
Could you please take a look?
Thanks.
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.
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 :)
ASKER
I added it. However
main.c
-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
main.c is attached.main.c
Add string.h
ASKER
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
line 1395 is char *malloc();
Ok, you may also need malloc.h :)
ASKER
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
http://www.gnu.org/s/hello/manual/gnulib/malloc.html
ASKER
-bash-4.1$ make msa --without-gnu-malloc
make: unrecognized option '--without-gnu-malloc'
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.
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.