LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Stumped with GCC error on first attempt at install from source (https://www.linuxquestions.org/questions/linux-newbie-8/stumped-with-gcc-error-on-first-attempt-at-install-from-source-756765/)

greymont 09-21-2009 08:08 AM

Stumped with GCC error on first attempt at install from source
 
I'm attempting to install rdesktop 1.6.0 from source into a relatively fresh Ubuntu 9.10 desktop 64bit.

I downloaded the tar.gz and unpacked it. The README says to
% ./configure
% make
% make install

so I did:

dpc@dpc-host:~/Desktop/rdesktop-1.6.0$ sudo su
root@dpc-host:/home/dpc/Desktop/rdesktop-1.6.0# ./configure
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.

I assume I cannot continue installing, so I looked at config.log and found:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by rdesktop configure 1.6.0, which was
generated by GNU Autoconf 2.61. Invocation command line was

$ ./configure

## --------- ##
## Platform. ##
## --------- ##

hostname = dpc-host
uname -m = x86_64
uname -r = 2.6.24-24-generic
uname -s = Linux
uname -v = #1 SMP Sat Aug 22 00:30:49 UTC 2009

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1829: checking for gcc
configure:1845: found /usr/bin/gcc
configure:1856: result: gcc
configure:2094: checking for C compiler version
configure:2101: gcc --version >&5
gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2104: $? = 0
configure:2111: gcc -v >&5
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)
configure:2114: $? = 0
configure:2121: gcc -V >&5
gcc: '-V' option must have argument
configure:2124: $? = 1
configure:2147: checking for C compiler default output file name
configure:2174: gcc conftest.c >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:2177: $? = 1
configure:2215: result:
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "rdesktop"
| #define PACKAGE_TARNAME "rdesktop"
| #define PACKAGE_VERSION "1.6.0"
| #define PACKAGE_STRING "rdesktop 1.6.0"
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2222: error: C compiler cannot create executables
See `config.log' for more details.

What do I do now?

druuna 09-21-2009 09:19 AM

Hi,

You seem to be missing crt1.o:

/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status


Which is part of the glibc (developer) package. I do believe (not an ubuntu user) that package is called libc6-dev for the ubuntu distro.

Install that and try again.

i92guboj 09-21-2009 09:20 AM

You probably need to install libc6-dev, glibc-dev or whatever it's called in ubuntu. Anyway, I think that ubuntu has some kind of meta-package or something like that called build-essentials, that should install everything you need in one sweep, so maybe you should take that route.

Another thing: you really don't need root privileges to compile anything, so, save yourself some pain, and skip the "sudo su" step. You don't need to be root to do the configure and make steps. You only need that when installing, "sudo make install" usually. However, and unless you have a good reason not to, you should stick to the official packages, and if not, at least be careful enough to use --prefix on the configure step to separate the manually installed files from the ubuntu ones so they don't get mixed. For example:

Code:

./configure --prefix=/usr/local

prasanta 09-21-2009 09:25 AM

You can install `rdesktop` using apt itself. Why take the pain of installing the dependencies when there is a wonderful tool available. In any case I think you require gcc, build-essential package.

Regards,

--
Prasanta

knudfl 09-21-2009 09:33 AM

Welcome to LQ.

sudo apt-get install rdesktop
.. will install version 1.6.0

Using 'apt-get install' or the package manager 'synaptic'
is the only correct way to install software on Ubuntu.

If you want to compile an application, not amongst the
26,000 available packages, you will have to do :
sudo apt-get install build-essential libc6-dev g++
.....
Good luck !
.....

johnsfine 09-21-2009 09:42 AM

Quote:

Originally Posted by knudfl (Post 3691719)
Using 'apt-get install' or the package manager 'synaptic'
is the only correct way to install software on Ubuntu.

Do you want to explain that extreme claim? Is it Ubuntu specific or applies to other Debian based distributions?

I would claim that using apt or a front end to apt, such as synaptic, is the easiest way to install any of the vast number of packages available that way. It is also more likely to result in a correct installation than other methods. It also leaves the installed software in a state that will be easier to maintain and upgrade later.

But I think all that just adds up to "best way", which is much less than "only correct way".

i92guboj 09-21-2009 09:48 AM

It's certainly the preferable way, as long as there's not any reason to do in any other way. That's what the package manager is there for: it keeps track of the installed files, their dependencies, watch for sanity to prevent packages fighting with each other, file collisions, incompatible versions, etc. etc. Something that you don't get if you install from source.

It just easier to use the package manager. Even if you want to compile something yourself, for a valid reason, I'd still build a proper .deb package, and then install it, rather than just throwing the binaries in your system without any care. And if that's too much for you, out of pure laziness which is the only excuse, then at least be smart and tidy and use --prefix, as said above.


All times are GMT -5. The time now is 12:40 AM.