public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: backward _warning and failure to execute
@ 2004-01-20 21:01 lrtaylor
  0 siblings, 0 replies; 3+ messages in thread
From: lrtaylor @ 2004-01-20 21:01 UTC (permalink / raw)
  To: gruen.lab, gcc-help

Jeff,

The warning you're getting is due to the fact that the source code is
not compliant with the latest ANSI standard for C++.  Bascially, with
the new standard, standard C++ headers no longer have the ".h"
extension.  For example, the old "iostream.h" is now "iostream".
However, the old headers are supported for the time being for backward
compatibility; they just generate the warning you are seeing below.

This warning is not the cause of your problem, however.  The problem is
that the C++ runtime library is not in one of the standard system
directories, so when you run the program it is not able to find it.
What you need to do is to add the directory containing libstdc++.so.5 to
your LD_LIBRARY_PATH variable before running the program.  For example,
if that library is in /usr/local/lib, then you would do something like
this:

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

Or, you could change your Makefile so that this path gets embedded in
the executable (which is probably preferable) by adding the following
argument to the LD_FLAGS variable:

-Wl,-rpath,/usr/local/lib

If it complains about that, then try 

-R/usr/local/lib

Of course, you need to replace /usr/local/lib with the correct directory
for your installation.

Cheers,
Lyle


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Gruen Lab
Sent: Tuesday, January 20, 2004 1:33 PM
To: gcc-help@gcc.gnu.org
Subject: backward _warning and failure to execute

Hello,

I am trying to compile a genetics analysis program ("transmit") on a 
sun station running SunOS5.9.  I believe that it has version 3.2 of 
c++, and version 3.2 of gcc.  There is a Makefile bundled with the 
program.  When I run "make" I get the following error messages:

gruen@/home/gruen/Applications/transmit-2.5.4% make
g++ -c   -DVERSION="\"2.5.4, Aug 2002\"" -DSEED=srand48 transmit.C
In file included from /usr/local/include/c++/3.2/backward/iostream.h:31,
                  from transmit.C:5:
/usr/local/include/c++/3.2/backward/backward_warning.h:32:2: warning: 
#warning This file includes at least one deprecated or antiquated 
header. Please consider using one of the 32 headers found in section 
17.4.1.2 of the C++ standard. Examples include substituting the <X> 
header for the <X.h> header for C++ includes, or <sstream> instead of 
the deprecated header <strstream.h>. To disable this warning use 
-Wno-deprecated.

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

* Re: backward _warning and failure to execute
  2004-01-20 20:33 Gruen Lab
@ 2004-01-20 21:07 ` John Love-Jensen
  0 siblings, 0 replies; 3+ messages in thread
From: John Love-Jensen @ 2004-01-20 21:07 UTC (permalink / raw)
  To: Gruen Lab, gcc-help

Hi Jeff,

GCC's g++ compiler is warning you that there are deprecated header files
being used.  Convert those header files to the ISO 14882-1998 standard.
Stroustrup's C++ Programming Language, 3rd or Special editions has more
information.

Basically...
#include <iostream.h>
...is out, replaced with...
#include <iostream>
using namespace std;

Make sure your LD_LIBRARY_PATH environment variable has the path location of
your libstdc++.so.5 shared library.

HTH,
--Eljay

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

* backward _warning and failure to execute
@ 2004-01-20 20:33 Gruen Lab
  2004-01-20 21:07 ` John Love-Jensen
  0 siblings, 1 reply; 3+ messages in thread
From: Gruen Lab @ 2004-01-20 20:33 UTC (permalink / raw)
  To: gcc-help

Hello,

I am trying to compile a genetics analysis program ("transmit") on a 
sun station running SunOS5.9.  I believe that it has version 3.2 of 
c++, and version 3.2 of gcc.  There is a Makefile bundled with the 
program.  When I run "make" I get the following error messages:

gruen@/home/gruen/Applications/transmit-2.5.4% make
g++ -c   -DVERSION="\"2.5.4, Aug 2002\"" -DSEED=srand48 transmit.C
In file included from /usr/local/include/c++/3.2/backward/iostream.h:31,
                  from transmit.C:5:
/usr/local/include/c++/3.2/backward/backward_warning.h:32:2: warning: 
#warning This file includes at least one deprecated or antiquated 
header. Please consider using one of the 32 headers found in section 
17.4.1.2 of the C++ standard. Examples include substituting the <X> 
header for the <X.h> header for C++ includes, or <sstream> instead of 
the deprecated header <strstream.h>. To disable this warning use 
-Wno-deprecated.
g++ -c   -DURAN=drand48 transfun.C
In file included from /usr/local/include/c++/3.2/backward/iostream.h:31,
                  from transfun.C:8:
/usr/local/include/c++/3.2/backward/backward_warning.h:32:2: warning: 
#warning This file includes at least one deprecated or antiquated 
header. Please consider using one of the 32 headers found in section 
17.4.1.2 of the C++ standard. Examples include substituting the <X> 
header for the <X.h> header for C++ includes, or <sstream> instead of 
the deprecated header <strstream.h>. To disable this warning use 
-Wno-deprecated.
g++ -c   cline.c
g++ -c   -DURAN=drand48 bstrap.c
g++ -c   profile.c
g++ -c   stats.c
g++ -c   matrix.c
g++  -o transmit transmit.o transfun.o cline.o profile.o matrix.o 
bstrap.o stats.o


After compiling there is an executable form of the program, but when I 
try to execute it I get the following error message:
gruen@/home/gruen/Applications/transmit-2.5.4% transmit
ld.so.1: transmit: fatal: libstdc++.so.5: open failed: No such file or 
directory
Killed

Apparently there was some fatal error in the compiling.  I would think 
that the fatal error is reflected in the warning messages produced 
during the compiling process (above) regarding a "deprecated or 
antiquated header".

Could you please offer a suggestion on how to fix this problem?

(I don't know if this is helpful but when I compile on transmit on 
MacOSX with the same Makefile the program compiles and executes 
flawlessly.  I would prefer, however to use this particular program on 
our Sun server for group use.  I have included the Makefile below.)

Thanks,

Jeff Gruen
gruen.lab@yale.edu

Makefile for transmit:
gruen@/home/gruen/Applications/transmit-2.5.4% more Makefile
VERSION = 2.5.4
DATE = Aug 2002

VER = "\"$(VERSION), $(DATE)\""
CMP = g++ -c
CMP_FLAGS =
LD = g++
LD_FLAGS =
UNIFORM_RANDOM = drand48
RANDOM_SEED = srand48
CMP = g++ -c
LD = g++

transmit : transmit.o transfun.o cline.o bstrap.o profile.o stats.o 
matrix.o
         $(LD) $(LD_FLAGS) -o transmit transmit.o transfun.o cline.o 
profile.o matrix.o bstrap.o stats.o

transmit.o : transmit.C transmit.h cline.h bstrap.h
         $(CMP) $(CMP_FLAGS) -DVERSION=$(VER) -DSEED=$(RANDOM_SEED) 
transmit.C

transfun.o : transfun.C transmit.h
         $(CMP) $(CMP_FLAGS) -DURAN=$(UNIFORM_RANDOM) transfun.C

cline.o : cline.c
         $(CMP) $(CMP_FLAGS) cline.c

profile.o : profile.c matrix.h
         $(CMP) $(CMP_FLAGS) profile.c

matrix.o : matrix.c matrix.h
         $(CMP) $(CMP_FLAGS) matrix.c

bstrap.o : bstrap.c bstrap.h matrix.h
         $(CMP) $(CMP_FLAGS) -DURAN=$(UNIFORM_RANDOM) bstrap.c

stats.o : stats.c
         $(CMP) $(CMP_FLAGS) stats.c

clean :
         rm -f *.o *~ transmit-$(VERSION).tar.gz transmit-$(VERSION).zip

distribution:
         mkdir transmit-$(VERSION)
         cp *.C *.c *.h *.doc test.dat Makefile  transmit-$(VERSION)/
         rm -f transmit-$(VERSION).tar.gz transmit-$(VERSION).zip
         tar cvf transmit-$(VERSION).tar transmit-$(VERSION)/*
         gzip transmit-$(VERSION).tar
         zip transmit-$(VERSION).zip transmit-$(VERSION)/*
         rm -f transmit-$(VERSION)/*

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

end of thread, other threads:[~2004-01-20 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-20 21:01 backward _warning and failure to execute lrtaylor
  -- strict thread matches above, loose matches on Subject: below --
2004-01-20 20:33 Gruen Lab
2004-01-20 21:07 ` John Love-Jensen

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).