Configure error: compiler cannot create working executables
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Configure error: compiler cannot create working executables
I'm trying to compile a program on Cygwin and it seems like as soon as I solve one problem, another pops up. This time, trying to run configure gets me an error message. The relevant part of my config.log is included below. Can anyone help me decode it?
NOTE: I installed Cygwin with everything that was in the Devel folder, just to be on the safe side.
configure:6621: checking compiler and flags for sanity
configure:6640: gcc -o conftest.exe -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare conftest.c /usr/lib/textmode.o >&5
conftest.c: In function 'main':
conftest.c:20: warning: implicit declaration of function 'exit'
conftest.c:20: warning: incompatible implicit declaration of built-in function 'exit'
configure:6643: $? = 0
configure:6645: ./conftest.exe
configure:6648: $? = 127
configure: program exited with status 127
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenSSH"
| #define PACKAGE_TARNAME "openssh"
| #define PACKAGE_VERSION "Portable"
| #define PACKAGE_STRING "OpenSSH Portable"
| #define PACKAGE_BUGREPORT "openssh-unix-dev@mindrot.org"
| #define LOGIN_PROGRAM_FALLBACK "/usr/bin/login"
| #define _PATH_PASSWD_PROG "/usr/bin/passwd"
| #define HAVE_CYGWIN 1
| #define USE_PIPES 1
| #define DISABLE_SHADOW 1
| #define IP_TOS_IS_BROKEN 1
| #define NO_X11_UNIX_SOCKETS 1
| #define NO_IPPORT_RESERVED_CONCEPT 1
| #define DISABLE_FD_PASSING 1
| /* end confdefs.h. */
|
| #include <stdio.h>
| int main(){exit(0);}
|
configure:6659: result: no
configure:6661: error: *** compiler cannot create working executables, check config.log ***
I have never used Cygwin, but I had this same, exact error once on my Slackware box. I had re-installed all the devel tools for gcc except one. While I don't remember now which one it was, Installing it allowed configure to continue. I would check everything off in that folder and make sure its installed.
The program you are configuring does not have the correct header file defining the function exit(). It probably needs the line
#include <stdlib.h>
after
#include <stdio.h>
Header files give function prototypes, defining what sort of object the function returns; since the program never looks for a return value from exit, older programs could get away without the prototype. Modern compilers are more picky. See here
Thanks for the advice. I tried installing Cygwin with everything that could be remotely relevant to compiling, going down each list manually to make sure everything was checked off, and it didn't help. I'll try editing the source files to include stdlib.h next.
Re-installed all the devel tools for gcc except one.The program you are configuring does not have the correct header file defining the function exit().
Last edited by archtoad6; 12-26-2010 at 04:12 PM.
Reason: remove sig. spam
I was able to fix the problem I posted above, but now I get a message saying there's a syntax error near an else-if statement. The offending statement is
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
Maybe I should really be posting this on a C forum?
I have already left you this Vistor Messsage (VM):
Quote:
Per the LQ Rules, There is no advertising allowed in the forums. If you are interested in advertising, please contact us. http://www.linuxquestions.org/rules.php
This includes your signature block, please edit it to remove the commercial links.
Thank you for your co-operation.
I am posting this because you have Private Messages (PMs) blocked; &, in spite of the fact you have logged on to LQ since I posted it, you may have not yet seen my VM. I hope you are not ignoring my request.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.