7

I am trying to do an installations of Linux Mint 16 'petra' on both 32 and 64 bit installs.

I have no internet connection on my pc so have to install all additional software manually. Being a developer I thought I would attempt to install codeblocks with wxWidgets so followed the instructions found at:

http://wiki.codeblocks.org/index.php?ti

In order to perform the installation it appeared that i would need pre-requistites so following instructions found on https://developer.gnome.org/gtk3/stable ... lding.html downloaded glib 'stuff', unpacked and ran configure.

It's at this point that things fail. I get a message in the terminal stating that the C compiler cannot create executables and to see config.log for more details which contains (amongst other stuff) the following:

gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu8) 
configure:4072: $? = 0
configure:4061: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4072: $? = 4
configure:4061: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.

How do I diagnose these errors?

poolie
  • 9,289
  • 1
  • 47
  • 74
user3118566
  • 71
  • 1
  • 1
  • 2
  • 2
    This is simply GNU autoconf probing for your compiler's version. GCC not being able to create executables usually means that you do not have the development headers of `Glibc` installed, i.e. there is (almost) nothing in `/usr/include`. – Hristo Iliev Dec 19 '13 at 09:44
  • Hi Hristo, thanks for taking the time to comment. is there any further instruction you can give me regarding what i need to do? Do i just search for the dev headers and try to install them? Really unfamiliar with linux so please excuse my lack of understanding. – user3118566 Dec 19 '13 at 10:11
  • Never used Mint, but in Ubuntu (and afaik Mint is derived from Ubuntu) the package is called `libc6-dev`. You might need other development headers too though. – Hristo Iliev Dec 19 '13 at 11:33
  • 1
    Can you compile and execute a simple "hello world" program? – Keith Thompson Jun 02 '14 at 03:11

5 Answers5

13

On some versions of gcc, the -V option tells it to use a specified version of the compiler -- but it requires an argument. It's documented here. The option appears to have been removed some time between 4.5.4 and 4.6.4.

But a configuration script like this is expected to do things that don't work, so it can determine what compiler it's using and what features it supports. It appears that at this point the script is not assuming that the compiler it's invoking is gcc; rather, it's trying a number of different options to get the compiler to report its own version number.

I think that the error message you've shown us:

gcc: error: unrecognized command line option '-V'

is not related to the problem you're encountering.

You need to focus on the portion of the log immediately preceding the error message that says the C compiler "cannot produce executables".

The first thing I'd try is to compile and execute a simple "hello, world" program. If that doesn't work, then you're missing something, and your compiler really doesn't work. If it does work, then you need to study the config.log file to see what's really causing the error.

I've sometimes hacked the configure script to print more information to track down problems like this. For example, it will generate and compiler a small C program; you can add code to save a copy of that C program and examine it separately.

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
3

I ran into this error because my Linux distro didn't come with everything it needed to compile C programs. The build-essentials meta package gave me everything I needed.

sudo apt-get install build-essential
steel
  • 11,883
  • 7
  • 72
  • 109
1

I had a situation similar to this. The configure and other commands would work fine if I ran them directly from the shell. My situation was different. I was running a ./configure && make from another Makefile and the CFLAGS variable was set. This produced an error like yours. It was because of the CFLAGS variable. It affects the way configure works. Running ./configure --help lists a few more that affect it. Perhaps you should check if any of those are set.

Noufal Ibrahim
  • 71,383
  • 13
  • 135
  • 169
  • `./configure --help lists a few more that affect it. ` You give the process which finding the reason. But what is your solution? empty `CFLAGS`? – Nick Dong Jun 20 '19 at 03:03
1

I faced the same error when installing python on RHEL 7. And Installing this lib is working for me:

yum install glibc-devel
yum install glibc-devel.i686
0

Thanks to Keith's hints. Met this problem twice. Initially it reports this in the shell print out:

gcc: error: unrecognized command line option '-V'

But checking the config.log reviewed the real problem, it caused by the permssion issue of the Linux guest's vboxsf shared folder. Copying the build target folder to a non-shared folder fixed it.

configure:3995: ./conftest
./configure: line 3997: ./conftest: Permission denied
configure:3999: $? = 126
configure:4006: error: in `/home/my_virtual_box_shared_folder':
wenbo
  • 26
  • 2