public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Use +z or +Z to recompile...
@ 2002-10-21  9:01 Venkatakrishnan, V
  2002-10-21  9:25 ` Jeff Law
  0 siblings, 1 reply; 8+ messages in thread
From: Venkatakrishnan, V @ 2002-10-21  9:01 UTC (permalink / raw)
  To: gcc-help

Hi,
	I'm using gcc ver 3.2 20020708 (experimental) on my HPUX 11.0 box.
	When building a shared library I get an error as follows....

/usr/ccs/bin/ld: DP relative code in file /var/tmp//ccCoJZUg.o - shared
library must be position independent.  Use +z or +Z to recompile.

	Now I'm already using the -fpic option while compiling my .c to .o
using which I then try to build my .sl, so I guess my object file is already
position independent.  Why the error during link though?
	Is there something I'm missing here??

Regards,
Venky



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

* Re: Use +z or +Z to recompile...
  2002-10-21  9:01 Use +z or +Z to recompile Venkatakrishnan, V
@ 2002-10-21  9:25 ` Jeff Law
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Law @ 2002-10-21  9:25 UTC (permalink / raw)
  To: Venkatakrishnan, V; +Cc: gcc-help

In message <8229C4577A00D511ABC00090277A45A0012361B1@us0111-ch-ms1.sdi.xcdg.xer
ox.com>, "Venkatakrishnan, V" writes:
 >Hi,
 >	I'm using gcc ver 3.2 20020708 (experimental) on my HPUX 11.0 box.
 >	When building a shared library I get an error as follows....
 >
 >/usr/ccs/bin/ld: DP relative code in file /var/tmp//ccCoJZUg.o - shared
 >library must be position independent.  Use +z or +Z to recompile.
 >
 >	Now I'm already using the -fpic option while compiling my .c to .o
 >using which I then try to build my .sl, so I guess my object file is already
 >position independent.  Why the error during link though?
 >	Is there something I'm missing here??
Use -fPIC rather than -fpic.
jeff

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

* RE: Use +z or +Z to recompile...
  2002-10-21 17:50   ` Nagu
@ 2002-10-23  3:45     ` Andrea Bocci
  0 siblings, 0 replies; 8+ messages in thread
From: Andrea Bocci @ 2002-10-23  3:45 UTC (permalink / raw)
  To: Nagu; +Cc: law, 'Venkatakrishnan, V', gcc-help

At 17.52 21/10/2002 -0700, Nagu wrote:

>Hi all,
>I have this problem of linking error using gcc, I have 4 simple files
>first.c (where main function is defined), and myfunc1, myfunc2 and
>incl.h (which defines another function called basefunc). When I compile,
>I get fatal error saying that multiply defined "basefunc". How to get
>rid of this?
>Thanks
>Best
>nagu

put

#ifndef INCL_H
#define INCL_H

at the top of incl.h

and

#endif // ifndef INCL_H

ad the end


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

* RE: Use +z or +Z to recompile...
  2002-10-21 10:55 ` Jeff Law
@ 2002-10-21 17:50   ` Nagu
  2002-10-23  3:45     ` Andrea Bocci
  0 siblings, 1 reply; 8+ messages in thread
From: Nagu @ 2002-10-21 17:50 UTC (permalink / raw)
  To: law, 'Venkatakrishnan, V'; +Cc: gcc-help


Hi all,
I have this problem of linking error using gcc, I have 4 simple files
first.c (where main function is defined), and myfunc1, myfunc2 and
incl.h (which defines another function called basefunc). When I compile,
I get fatal error saying that multiply defined "basefunc". How to get
rid of this? 
Thanks
Best
nagu

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

* Re: Use +z or +Z to recompile...
  2002-10-21 10:57 Venkatakrishnan, V
@ 2002-10-21 11:04 ` Jeff Law
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Law @ 2002-10-21 11:04 UTC (permalink / raw)
  To: Venkatakrishnan, V; +Cc: gcc-help

In message <8229C4577A00D511ABC00090277A45A0012361B3@us0111-ch-ms1.sdi.xcdg.xer
ox.com>, "Venkatakrishnan, V" writes:
 >Ah I see, now that I am using it during linking as well it worked, thanks
 >Jeff :).
 >But how come it wasn't sufficient to use it during compile only, why
 >explicitly at link as well??
Because code is also generated at link time to handle static constructors
and destructors.

jeff

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

* RE: Use +z or +Z to recompile...
@ 2002-10-21 10:57 Venkatakrishnan, V
  2002-10-21 11:04 ` Jeff Law
  0 siblings, 1 reply; 8+ messages in thread
From: Venkatakrishnan, V @ 2002-10-21 10:57 UTC (permalink / raw)
  To: 'law@redhat.com'; +Cc: gcc-help

Ah I see, now that I am using it during linking as well it worked, thanks
Jeff :).
But how come it wasn't sufficient to use it during compile only, why
explicitly at link as well??

-----Original Message-----
From: Jeff Law [mailto:law@porcupine.cygnus.com] 
Sent: Monday, October 21, 2002 2:03 PM
To: Venkatakrishnan, V
Cc: gcc-help@gcc.gnu.org
Subject: Re: Use +z or +Z to recompile... 


In message
<8229C4577A00D511ABC00090277A45A0012361B2@us0111-ch-ms1.sdi.xcdg.xer
ox.com>, "Venkatakrishnan, V" writes:
 >Using -fPIC gives the same error.
Did you use it when linking your shared library as well?
jeff

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

* Re: Use +z or +Z to recompile...
  2002-10-21 10:47 Venkatakrishnan, V
@ 2002-10-21 10:55 ` Jeff Law
  2002-10-21 17:50   ` Nagu
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Law @ 2002-10-21 10:55 UTC (permalink / raw)
  To: Venkatakrishnan, V; +Cc: gcc-help

In message <8229C4577A00D511ABC00090277A45A0012361B2@us0111-ch-ms1.sdi.xcdg.xer
ox.com>, "Venkatakrishnan, V" writes:
 >Using -fPIC gives the same error.
Did you use it when linking your shared library as well?
jeff

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

* RE: Use +z or +Z to recompile...
@ 2002-10-21 10:47 Venkatakrishnan, V
  2002-10-21 10:55 ` Jeff Law
  0 siblings, 1 reply; 8+ messages in thread
From: Venkatakrishnan, V @ 2002-10-21 10:47 UTC (permalink / raw)
  To: 'law@redhat.com'; +Cc: gcc-help

Using -fPIC gives the same error.

-----Original Message-----
From: Jeff Law [mailto:law@porcupine.cygnus.com] 
Sent: Monday, October 21, 2002 12:34 PM
To: Venkatakrishnan, V
Cc: gcc-help@gcc.gnu.org
Subject: Re: Use +z or +Z to recompile... 


In message
<8229C4577A00D511ABC00090277A45A0012361B1@us0111-ch-ms1.sdi.xcdg.xer
ox.com>, "Venkatakrishnan, V" writes:
 >Hi,
 >	I'm using gcc ver 3.2 20020708 (experimental) on my HPUX 11.0 box.
 >	When building a shared library I get an error as follows....
 >
 >/usr/ccs/bin/ld: DP relative code in file /var/tmp//ccCoJZUg.o - shared
>library must be position independent.  Use +z or +Z to recompile.  >
 >	Now I'm already using the -fpic option while compiling my .c to .o
 >using which I then try to build my .sl, so I guess my object file is
already  >position independent.  Why the error during link though?
 >	Is there something I'm missing here??
Use -fPIC rather than -fpic.
jeff

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

end of thread, other threads:[~2002-10-23 10:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-21  9:01 Use +z or +Z to recompile Venkatakrishnan, V
2002-10-21  9:25 ` Jeff Law
2002-10-21 10:47 Venkatakrishnan, V
2002-10-21 10:55 ` Jeff Law
2002-10-21 17:50   ` Nagu
2002-10-23  3:45     ` Andrea Bocci
2002-10-21 10:57 Venkatakrishnan, V
2002-10-21 11:04 ` Jeff Law

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