public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: g++ Question
@ 2000-08-20 10:59 Jones Wilson
  0 siblings, 0 replies; 3+ messages in thread
From: Jones Wilson @ 2000-08-20 10:59 UTC (permalink / raw)
  To: gcc-help

>I'd suggest you to look into binary compatibility problems >between the
>libstdc++ the program is linked with and the one being found at
>run-time.  Try to link with -static, to make sure.

Thanks for your help, that seems to be it.
When I linked with -static it worked fine.  How can I go about fixing this?  I've just got the libstdc++ that came with gcc-2.95.2.  Do I need to download another libstdc++ package, or add some line to ld.so.conf or something so that I can link dynamically?

I've also got another (hopefully) quick question.  I installed gcc with prefix=/usr.  When I compile stuff, it doesn't look for header files in /usr/local/include.  I can get around it with a C_INCLUDE_PATH environmental variable, but is there some way to explicitly configure/compile gcc so that it will look there always?

Thanks again for your help.
Tom

______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup

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

* Re: g++ Question
  2000-08-18 16:41 Jones Wilson
@ 2000-08-18 17:02 ` Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2000-08-18 17:02 UTC (permalink / raw)
  To: Jones Wilson; +Cc: gcc-help

On Aug 18, 2000, Jones Wilson <burrodomo@mail.com> wrote:

> when I compile it using g++ and then try running it, I get only a
> segmentation fault

I'd suggest you to look into binary compatibility problems between the
libstdc++ the program is linked with and the one being found at
run-time.  Try to link with -static, to make sure.  If that's not it,
run the program within a debugger to get further details.

> root:lib# ln -s ../usr/lib/gcc-lib/<host>/2.95.2/cpp cpp

Wrong.  You want usr/bin/cpp there.

-- 
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] 3+ messages in thread

* g++ Question
@ 2000-08-18 16:41 Jones Wilson
  2000-08-18 17:02 ` Alexandre Oliva
  0 siblings, 1 reply; 3+ messages in thread
From: Jones Wilson @ 2000-08-18 16:41 UTC (permalink / raw)
  To: gcc-help

I have installed gcc-2.95.2 from source.  I have a problem compiling C++
programs.  No matter how simple the program, even just int main() { return
0; }, when I compile it using g++ and then try running it, I get only a
segmentation fault.  There are no warnings or errors on compiling or
linking, and the executable is created, but when I run that executable I
only get "Segmentation Fault", no matter what.  I am assuming this is some
problem with my configuration of gcc, but I'm clueless as to what, so if
anyone could help me I'd be grateful.  Here are the steps I used to compile
gcc, from the gcc-build dir:

root:gcc-build# ../gcc-2.95.2/configure --prefix=/usr \
> --with-gxx-include-dir=/usr/include/g++ \
> --enable-shared --enable-languages=c,c++
root:gcc-build# make bootstrap
root:gcc-build# make install

root:~# cd /lib
root:lib# ln -s ../usr/lib/gcc-lib/<host>/2.95.2/cpp cpp
root:lib# cd /usr/lib
root:lib# ln -s gcc-lib/<host>/2.95.2/cpp cpp
root:lib# cd /usr/bin
root:bin# ln -s gcc cc

I am using the 2.2.14 kernel with a Linux distribution built following the
Linux From Scratch HOWTO 2.3.5b.  My C compiler does seem to be working
fine.  Is this some problem with how I compiled gcc, or some library thing? 
Thanks very much for any help.
Tom


______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup

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

end of thread, other threads:[~2000-08-20 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-20 10:59 g++ Question Jones Wilson
  -- strict thread matches above, loose matches on Subject: below --
2000-08-18 16:41 Jones Wilson
2000-08-18 17:02 ` Alexandre Oliva

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