public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrea 'Fyre Wyzard' Bocci <fwyzard@inwind.it>
To: "Venkatakrishnan, V" <V.Venkatakrishnan@channels.usa.xerox.com>,
	gcc-help@gcc.gnu.org
Subject: Re: A simple problem regarding shared libs...
Date: Fri, 08 Feb 2002 18:49:00 -0000	[thread overview]
Message-ID: <5.1.0.14.0.20020209022837.02b9eec8@popmail.inwind.it> (raw)
In-Reply-To: <8229C4577A00D511ABC00090277A45A0ADBA0D@us0111-ch-ms1.chann els.mc.xerox.com>

Hi

I've tried reproducing your problem, but on my machine everything went 
smoothly.
Also, I've not set LD_LIBRARY_PATH in any way. Just typed, and it worked !
(gcc 2.96 and gcc 3.0.2, binutils 2.11.90, linux 2.4.7, RedHat 7.2)

[fwyzard@stufis06 test]$ gcc sharobj.c -c -o sharobj.o
[fwyzard@stufis06 test]$ gcc hello.c -c -o hello.o
[fwyzard@stufis06 test]$ gcc sharobj.o -shared -o libshared.so
[fwyzard@stufis06 test]$ gcc hello.o -L. -lshared -o hello
[fwyzard@stufis06 test]$ ./hello
Hello World
Hello from shared lib

Here's the files I've used:
/* hello.c */
#include <stdio.h>

extern const char* func();
int main( void)
{
         printf("Hello World\n");
         func();
         return 1;
}
/* end of hello.c */

/* sharobj.c */
#include <stdio.h>

const char* func(void)
{
         printf("Hello from shared lib\n");
}
/* end of sharobj.c */

fwyzard

       reply	other threads:[~2002-02-09  1:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8229C4577A00D511ABC00090277A45A0ADBA0D@us0111-ch-ms1.chann els.mc.xerox.com>
2002-02-08 18:49 ` Andrea 'Fyre Wyzard' Bocci [this message]
2002-02-11  9:38 Venkatakrishnan, V
  -- strict thread matches above, loose matches on Subject: below --
2002-02-08 10:38 Venkatakrishnan, V
2002-02-08 10:20 Venkatakrishnan, V
2002-02-08  9:30 Venkatakrishnan, V
2002-02-08  9:58 ` John Love-Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.1.0.14.0.20020209022837.02b9eec8@popmail.inwind.it \
    --to=fwyzard@inwind.it \
    --cc=V.Venkatakrishnan@channels.usa.xerox.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).