msk
msk

Reputation: 135

incompatible compilation error built-in function ‘execl’

I am compiling crashme source code on windows using cywin and i am facing some compilation error.

Error:

crashme.c: In function 'vfork_main':
crashme.c:594: warning: incompatible implicit declaration of built-in function ‘execl’

Though the source code had unistd.h included, but still the error persisting. Kindly help me how to fix this issue.

Upvotes: 1

Views: 8025

Answers (3)

George Carrette
George Carrette

Reputation: 721

I have recently updated http://crashme.codeplex.com/ source code to work on Mac OS X Lion with Xcode command line tools, with changes to make it more potent on 64-bit x64 architectures. But under Windows I would suggest using the native windows port instead of cygwin, using the pre-compiled windows installer msi file. You can report bugs/issues on the codeplex site.

Upvotes: 0

Keith Thompson
Keith Thompson

Reputation: 263237

The source doesn't have unistd.h included.

I wasn't able to open crashme.zip, but I was able to partially unpack crashme.tgz.

crashme.c has the following (lines 150-152):

#ifdef linux
#include <unistd.h>
#endif

You're compiling on Cygwin, which is not a Linux system, so of course the symbol linux is not defined. As a result, the #include <unistd.h> is skipped.

That's surprising, since <unistd.h> should be available on all Unix-like (i.e., POSIX) systems, not just Linux -- and comments in the source indicate that it's been used on SunOS 4.1.1 and several other Unix systems.

Commenting out the #ifdef linux and #endif lines should fix the immediate problem, but I have no idea what other problems might be lurking behind it. It's going to take some unknown amount of effort to get this working under Cygwin.

Upvotes: 1

Probably a missing #include of the "system" header defining execl (i.e. <unistd.h> on Linux).

To find out what is included, use gcc -H -c foo.c and use gcc -C -E -Wall foo.c > foo.i to get the preprocessed form.

Upvotes: 5

Related Questions