LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 12-09-2010, 03:27 PM   #1
huntress77
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Rep: Reputation: 5
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 ***
 
Old 12-10-2010, 12:18 AM   #2
mlangdn
Senior Member
 
Registered: Mar 2005
Location: Kentucky
Distribution: Slackware64-current
Posts: 1,845

Rep: Reputation: 452Reputation: 452Reputation: 452Reputation: 452Reputation: 452
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.
 
Old 12-15-2010, 08:44 AM   #3
Peverel
Member
 
Registered: May 2009
Location: Chelmsford, England
Distribution: OpenSuse 12.2 and 13.2, Leap 4.2
Posts: 128

Rep: Reputation: 24
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

http://gcc.gnu.org/gcc-4.3/porting_to.html

Last edited by Peverel; 12-15-2010 at 02:42 PM. Reason: clarification
 
Old 12-15-2010, 05:40 PM   #4
huntress77
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Original Poster
Rep: Reputation: 5
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.
 
Old 12-16-2010, 12:15 AM   #5
rentalsolutions
LQ Newbie
 
Registered: Feb 2010
Posts: 14

Rep: Reputation: 0
Having a problem installing a new program?

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
 
Old 12-20-2010, 12:46 PM   #6
huntress77
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Original Poster
Rep: Reputation: 5
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?
 
Old 12-26-2010, 12:51 PM   #7
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
rentalsolutions,

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.


Please take care of this ASAP. Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
configure: error: C compiler cannot create executables 2handband Slackware 10 06-12-2010 09:36 AM
configure: error: C compiler cannot create executables RLH1919 Slackware 6 11-13-2009 07:05 PM
configure: error: C compiler cannot create executables watashiwaotaku7 Linux - General 7 10-22-2009 09:40 AM
configure: error: C compiler cannot create executables Mysteries Linux - Software 5 05-21-2006 01:22 AM
configure: error: C compiler cannot create executables strimp099 Linux - Software 2 07-11-2005 07:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration