This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: maybe successful build of gcc-20020304 and gnat


At 21:48 10/03/2002 -0800, scott worley wrote:
>Hi,
>
>I was able to build the gcc-20020304 snapshot with GNAT by:
>
>gcc 2.95.3
>binutils 2.11.92.0.12.3 20011121
>glibc 2.2.4
>
>For the Ada compiler I used Debian's GNAT 3.14p.
>
>Configure gcc with
>--program-suffix=-3.1b
>--enable-shared
>--enable-threads
>--enable-version-specific-runtime-libs
>--enable-languages=ada,c,c++,objc,f77
>--enable-nls
>--without-included-gettext
>
>Followed the instructions to build GNAT,
>make bootstrap
>cd gcc
>make gnatlib_and_tools
>
>So now I've got the new gcc under /usr/local.  A small hello.c will
>compile and run but I'm unable to compile c++ test program.
>
>#include <iostream>
>
>class stupidExample {
>...
>}
>
>int main()
>{
>         stupidExample example1;
>
>         cout << "Test class method " << example1.getValue() << "\n";
>
>         return(0);
>}
>
>The compiler complains about cout not being defined.  Must I provide a
>path for c++ header files?
>
>make install put the c++ headers in:
>/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/include/g++
>
>I've tried using this path with -I or #include with no luck.  My c test
>program included stdlib.h & stdio.h which live in the same dir hierarchy
>and gcc-3.1b found them.
>
>What stupid mistake have I made?


I've been through this over the last few days and
have been kindly helped by various people. Thanks! Here's
the most useful advice in relation to your problem...

Try this for your C++ test:

#include <iostream>
using std:: cout; using std::endl;
int main ()
{
cout << "Hello World!" << endl;
return 0;
}

check on your compiler version:
gcc -v or g++ -v

Build with:
g++ -o foo foo.cpp -L/usr/local/lib
or (for example)...
/usr/local/bin/g++ -o foo foo.cpp -L/usr/local/lib



(see the recent mail from Kayvan A. Sylvan )

And do this if everything works...

"In your specs file (you can find its location by ``gcc -v''), add the
-L/usr/local/lib to the head of the "*link:" section and now
you no longer have to use the -L flag and other gcc versions
can co-exist peacefully."

HTH

Pete



>Also, out of curiosity I looked at gcc-3.1 & g++-3.1 binaries with a hex
>editor and both are full of paths to the gcc-2.95.3 in /usr.  Is the
>default gcc-20020304 build setup with debug info. or does this mean I
>screwed the build up.
>
>thanks,
>scott
>folokai@earhtlink.net
>
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]