public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ compiler cannot create executables.
@ 2001-03-19  9:50 lbergman
  2001-03-19 21:16 ` Alexandre Oliva
  0 siblings, 1 reply; 6+ messages in thread
From: lbergman @ 2001-03-19  9:50 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 5258 bytes --]

First, I must say I believe this might be a problem related to RH7.0
I have updated all gcc and libstdc stuff per RH errata.

[root@lewis /root]# rpm -q gcc
gcc-2.96-69
[root@lewis /root]# gcc --version
2.96
 [root@lewis /root]# automake --version
automake (GNU automake) 1.4
[root@lewis /root]# /sbin/ldconfig --version
ldconfig (GNU libc) 2.2 
[root@lewis /root]# rpm -q binutils
binutils-2.10.0.18-1 

I found an email in an archive that referenced running gcc on this file:
[root@lewis /root]# cat hello.cc
int main()
{}   

Which yeilded the following result :
[root@lewis /root]# cat hello.o
ELFÀ4(  U‰å¸]01.01GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.0).symtab.strtab.shstrtab.text.data.bss.note.comment
!@@,@2T.‚;(    ¸ñÿ
 
hello.ccgcc2_compiled.mainkonsole

I am unsure where to turn next as RedHat doesn't support the compiler. They
only support the binary programs, (even though the compiler is one).

As a secondary note here is an example of some of the config.log file errors
that are shown when a real program is configured:

This is PHP4. Sorry for the long list but I thought it might be helpfull.
configure:1299: checking for a BSD compatible install
configure:1352: checking whether build environment is sane
configure:1409: checking whether make sets ${MAKE}
configure:1448: checking for working aclocal
configure:1461: checking for working autoconf
configure:1474: checking for working automake
configure:1487: checking for working autoheader
configure:1500: checking for working makeinfo
configure:1530: checking whether to enable maintainer-specific portions of Makefiles
configure:1559: checking host system type
configure:1587: checking for gawk
configure:1621: checking for bison
configure:1655: checking bison version
configure:1668: checking for gcc
configure:1781: checking whether the C compiler (gcc  ) works
configure:1797: gcc -o conftest    conftest.c  1>&5
configure:1823: checking whether the C compiler (gcc  ) is a cross-compiler
configure:1828: checking whether we are using GNU C
configure:1837: gcc -E conftest.c
configure:1856: checking whether gcc accepts -g
configure:1888: checking how to run the C preprocessor
configure:1909: gcc -E  conftest.c >/dev/null 2>conftest.out
configure:1968: checking for AIX
configure:2013: checking for gcc option to accept ANSI C
configure:2066: gcc  -c -g -O2  conftest.c 1>&5
configure:2093: checking for ranlib
configure:2122: checking whether gcc and cc understand -c and -o together
configure:2137: gcc -c conftest.c -o conftest.o 1>&5
configure:2138: gcc -c conftest.c -o conftest.o 1>&5
configure:2143: cc -c conftest.c 1>&5
configure:2145: cc -c conftest.c -o conftest.o 1>&5
configure:2146: cc -c conftest.c -o conftest.o 1>&5
configure:2173: checking whether ln -s works
configure:2200: checking for flex
configure:2233: checking for flex
configure:2267: checking for yywrap in -lfl
configure:2286: gcc -o conftest -g -O2   conftest.c -lfl   1>&5
configure:2309: checking lex output file root
configure:2330: checking whether yytext is a pointer
configure:2349: gcc -o conftest -g -O2   conftest.c  -lfl 1>&5
configure:2372: checking for working const
configure:2426: gcc -c -g -O2  conftest.c 1>&5
configure:2543: gcc -o conftest -g -O2   conftest.c  1>&5
/tmp/ccKP70uF.o: In function `main':
/root/tar/php-4.0.4pl1/configure:2538: undefined reference to `pthread_mutexattr_init'
/root/tar/php-4.0.4pl1/configure:2539: undefined reference to `pthread_create'
collect2: ld returned 1 exit status
configure: failed program was:
#line 2525 "configure"
#include "confdefs.h"
                                                                                                                                           
This same configure and confdefs.h appear a ton of times but usually with
differing line numbers.


This is the last few lines of config.log:
configure:36451: checking for c++
configure:36483: checking whether the C++ compiler (c++   -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/lib/lib -L/usr/lib/lib -Wl,-rpath,/usr/X11R6/lib/lib -L/usr/X11R6/lib/lib -Wl,-rpath,/lib -L/lib -Wl,-rpath,/usr/lib/mysql -L/usr/lib/mysql -Wl,-rpath,/usr/lib/pgsql -L/usr/lib/pgsql) works
configure:36499: c++ -o conftest   -DLINUX=22 -DMOD_SSL=208100 -DEAPI -DEAPI_MM -DUSE_EXPAT  -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/lib/lib -L/usr/lib/lib -Wl,-rpath,/usr/X11R6/lib/lib -L/usr/X11R6/lib/lib -Wl,-rpath,/lib -L/lib -Wl,-rpath,/usr/lib/mysql -L/usr/lib/mysql -Wl,-rpath,/usr/lib/pgsql -L/usr/lib/pgsql conftest.C -lqt -lpspell -lpq -lmysqlclient -lmhash -lldap -llber -lgmp -lt1 -lttf -lgd -lX11 -lXpm -ljpeg -lcurl -lresolv -lm -ldl -lcrypt -lnsl  -lresolv -L/usr/lib/lib -ljpeg -L/usr/X11R6/lib/lib -lXpm -L/usr/X11R6/lib/lib -lX11 -L/lib -lt1 1>&5
/usr/bin/ld: cannot find -lqt
collect2: ld returned 1 exit status
configure: failed program was:
 
#line 36494 "configure"
#include "confdefs.h"
 
int main(){return(0);}

I have reinstalled all the lates rpm's with respect to binutils, gcc and libc,
libstdc. I have even tried the snapshot of gcc from gnu.org. I am really at a
loss here.

Any help would be greatly appreciated.
--
Lewis Bergman
Texas Communications
4309 Maple St.
Abilene, TX 79602
915-695-6962

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: C++ compiler cannot create executables.
  2001-03-19  9:50 C++ compiler cannot create executables lbergman
@ 2001-03-19 21:16 ` Alexandre Oliva
  2001-03-20  7:31   ` lbergman
  0 siblings, 1 reply; 6+ messages in thread
From: Alexandre Oliva @ 2001-03-19 21:16 UTC (permalink / raw)
  To: lbergman; +Cc: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

On Mar 19, 2001, lbergman <lbergman@abi.tconline.net> wrote:

> [root@lewis /root]# cat hello.o
> ELFÀ4(  
U‰
å¸]01.01GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.0).symtab.strtab.shstrtab.text.data.bss.note.comment

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: C++ compiler cannot create executables.
  2001-03-19 21:16 ` Alexandre Oliva
@ 2001-03-20  7:31   ` lbergman
  2001-03-20 10:20     ` Alexandre Oliva
  0 siblings, 1 reply; 6+ messages in thread
From: lbergman @ 2001-03-20  7:31 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc-help

On Mon, 19 Mar 2001, Alexandre Oliva wrote:
> What is it that you think is wrong with this file?  Looks reasonable
> to me...
It looked that way to me as well.

> >configure:2543: gcc -o conftest -g -O2   conftest.c  1>&5
> >/tmp/ccKP70uF.o: In function `main':
> >/root/tar/php-4.0.4pl1/configure:2538: undefined reference to
> >`pthread_mutexattr_init' > /root/tar/php-4.0.4pl1/configure:2539: undefined
> >reference to `pthread_create'

> Looks like the PHP configure is missing the flags to link the threads
> library in.  Or maybe it does that later on?  I.e., it has nothing to
> do with GCC.
Don't really know enough about this to even comment.

> >/usr/bin/ld: cannot find -lqt

> So, it couldn't find the qt library.  Again, why do you think this is
> a problem in GCC?
Yes. That and X11. But the only reason I emailed this list is that the exact
same package has worked severel times before. In fact, it worked several times
the same day before it gave up. I am not saying that it is gcc. On the other
hand, gcc is the one that errors and I was hoping someone who knew enough about
it could point me to the real problem.

I believe due to the problems with gcc not being able to find X11 or qt that
there might be a problem with the linker or maybe ldconfig. I believe the
problem might be related to the running of ldconfig to add a lib path
(something I have done several times before without problems).

At any rate, can you give me a clue as to where the real problem might reside?

--
Lewis Bergman
Texas Communications
4309 Maple St.
Abilene, TX 79602
915-695-6962

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: C++ compiler cannot create executables.
  2001-03-20  7:31   ` lbergman
@ 2001-03-20 10:20     ` Alexandre Oliva
  0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Oliva @ 2001-03-20 10:20 UTC (permalink / raw)
  To: lbergman; +Cc: gcc-help

On Mar 20, 2001, lbergman <lbergman@abi.tconline.net> wrote:

>> >/usr/bin/ld: cannot find -lqt

>> So, it couldn't find the qt library.  Again, why do you think this is
>> a problem in GCC?

> Yes. That and X11. But the only reason I emailed this list is that
> the exact same package has worked severel times before. In fact, it
> worked several times the same day before it gave up. I am not saying
> that it is gcc. On the other hand, gcc is the one that errors and I
> was hoping someone who knew enough about it could point me to the
> real problem.

It's not GCC that errors.  It's the linker, that is part of GNU
binutils, a separate project.

Anyway, if this thing fails at random, you've probably got some
hardware problem.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: C++ compiler cannot create executables
  2007-09-14  8:54 ` IVAN ANGELOV
@ 2007-09-14 15:20   ` Tim Prince
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Prince @ 2007-09-14 15:20 UTC (permalink / raw)
  To: IVAN ANGELOV; +Cc: gcc-help

IVAN ANGELOV wrote:
> ---------- Forwarded message ----------
> From: IVAN ANGELOV <ivangotoy@gmail.com>
> Date: 14.09.2007 10:11
> Subject: C++ compiler cannot create executables
> To: gcc-help@gcc.gnu.org
> 
> Yesterday (13.09.2007) I downloaded the full GCC trunk from svn. It
> was around 300 mb in size. I followed the installation instructions as
> much as I could.
> I made objdir on my desktop and I ran :
>  /home/ivan/Desktop/gcc/configure --prefix=/usr/local/gcc/gcc- 4.3.0
> --enable-shared --enable-threads=posix --enable-tls
> --with-gmp=/usr/lib --with-mpfr=/usr/lib
> 
> then I ran make bootsrap and went to bed. I didn't have enough
> patience to wait for the tests make -k check process and I commited
> make install :)
> then I symbolically linked gcc , cpp , g++ c++ gccbug gcj gcov
> gfortran from :/usr/local/gcc/gcc-4.3.0/bin to /usr/bin
> then I simply tried to ./configure a piece of code and the shell said:
> 
> checking for C++ compiler default output file name... configure:
> error: C++ compiler cannot create executables
> See `config.log' for more details.
> 
> The config.log points out:
> 
> configure:2113: g++    conftest.cc  >&5
> /usr/bin/ld: crtbegin.o: No such file: No such file or directory

The part about symlink surely wasn't in the installation instructions.
You don't want to set up a build in such a way that your original gcc
can be trashed.  Test your new compiler in a separate installation from
the original, or before installing.  Then, if you want to replace the
compiler in /usr/bin, reconfigure with -prefix=usr and install.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* C++ compiler cannot create executables
       [not found] <c51c48d0709140011t7806975er6d07c148481ae822@mail.gmail.com>
@ 2007-09-14  8:54 ` IVAN ANGELOV
  2007-09-14 15:20   ` Tim Prince
  0 siblings, 1 reply; 6+ messages in thread
From: IVAN ANGELOV @ 2007-09-14  8:54 UTC (permalink / raw)
  To: gcc-help

---------- Forwarded message ----------
From: IVAN ANGELOV <ivangotoy@gmail.com>
Date: 14.09.2007 10:11
Subject: C++ compiler cannot create executables
To: gcc-help@gcc.gnu.org

Yesterday (13.09.2007) I downloaded the full GCC trunk from svn. It
was around 300 mb in size. I followed the installation instructions as
much as I could.
I made objdir on my desktop and I ran :
 /home/ivan/Desktop/gcc/configure --prefix=/usr/local/gcc/gcc- 4.3.0
--enable-shared --enable-threads=posix --enable-tls
--with-gmp=/usr/lib --with-mpfr=/usr/lib

then I ran make bootsrap and went to bed. I didn't have enough
patience to wait for the tests make -k check process and I commited
make install :)
then I symbolically linked gcc , cpp , g++ c++ gccbug gcj gcov
gfortran from :/usr/local/gcc/gcc-4.3.0/bin to /usr/bin
then I simply tried to ./configure a piece of code and the shell said:

checking for C++ compiler default output file name... configure:
error: C++ compiler cannot create executables
See `config.log' for more details.

The config.log points out:

configure:2113: g++    conftest.cc  >&5
/usr/bin/ld: crtbegin.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:2116: $? = 1
configure: failed program was:

Some information about versions of software:

$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /home/ivan/Desktop/gcc/configure
--prefix=/usr/local/gcc/gcc- 4.3.0 --enable-shared
--enable-threads=posix --enable-tls --with-gmp=/usr/lib
--with-mpfr=/usr/lib
Thread model: posix
gcc version 4.3.0 20070913 (experimental) (GCC)
$

$ uname -a
Linux ubuntu-710  2.6.22.6 #5 PREEMPT Tue Sep 11 20:16:43 EEST 2007
i686 GNU/Linux
$

$ dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                  Version               Description
+++-=====================-=====================-==========================================================
ii  libc6                 2.6.1-1ubuntu4        GNU C Library: Shared libraries
$

 The distro is ubuntu gutsy gibbon regularly updated and I simply add
custom software for a change like gcc now.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-09-14 13:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-19  9:50 C++ compiler cannot create executables lbergman
2001-03-19 21:16 ` Alexandre Oliva
2001-03-20  7:31   ` lbergman
2001-03-20 10:20     ` Alexandre Oliva
     [not found] <c51c48d0709140011t7806975er6d07c148481ae822@mail.gmail.com>
2007-09-14  8:54 ` IVAN ANGELOV
2007-09-14 15:20   ` Tim Prince

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).