public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Shared modules on Solaris+egcs
@ 1999-04-20 14:24 Juan Antonio Magallon
  1999-04-30 23:15 ` Juan Antonio Magallon
  0 siblings, 1 reply; 2+ messages in thread
From: Juan Antonio Magallon @ 1999-04-20 14:24 UTC (permalink / raw)
  To: egcs

Hi everyone.

I have a problem with shared objects. First of all, I haven't found
anything about this in the FAQ. If anybody knows a place to find info
about this, please mail me...

I want to build dynamically loaded modules to implement various image formats
(and other things).
Each module for a particular task needs to have a fixed name function, say
all image modules have to offer a 'putline' function, to search with dlsym().

System is a Solaris 2.6 + egcs1.1.2 (collect2 uses ld).
I build shared modules with
g++ -O3 -mcpu=ultrasparc -fPIC xxx.cc
g++ -O3 -mcpu=ultrasparc -shared -Wl,-G -o xxx.so xxx.o
	(need -G to shut up ld about unresolved symbols...why -shared
		doesn't do it automatically ???)

I load the module with dlopen() (tried both with RTLD_NOW and _LAZY),
and it claims like:
ld.so.1: grt: fatal: relocation error: file
/home/magallon/usr/ale/lib/if/ppm.so: symbol _vt.8ofstream.3ios: referenced
symbol not found

If I declare an ofstream in the main program, it works fine.
So ofstream is not available to the shared module if I don't use one.

Any suggestion ?
Perhaps -O3 skips linking libstdc++ if I don't use streams...?
Linking xxx.o with -lstdc++ only gives me unresolveds....

Thanks in advance

-- 
Juan Antonio Magallon Lacarta             mailto:magallon@ivo.cps.unizar.es
Grupo de Informatica Grafica Avanzada             http://giga.cps.unizar.es
Tlf: 34-976-761939,1916 - Fax: 34-976-762111

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

* Shared modules on Solaris+egcs
  1999-04-20 14:24 Shared modules on Solaris+egcs Juan Antonio Magallon
@ 1999-04-30 23:15 ` Juan Antonio Magallon
  0 siblings, 0 replies; 2+ messages in thread
From: Juan Antonio Magallon @ 1999-04-30 23:15 UTC (permalink / raw)
  To: egcs

Hi everyone.

I have a problem with shared objects. First of all, I haven't found
anything about this in the FAQ. If anybody knows a place to find info
about this, please mail me...

I want to build dynamically loaded modules to implement various image formats
(and other things).
Each module for a particular task needs to have a fixed name function, say
all image modules have to offer a 'putline' function, to search with dlsym().

System is a Solaris 2.6 + egcs1.1.2 (collect2 uses ld).
I build shared modules with
g++ -O3 -mcpu=ultrasparc -fPIC xxx.cc
g++ -O3 -mcpu=ultrasparc -shared -Wl,-G -o xxx.so xxx.o
	(need -G to shut up ld about unresolved symbols...why -shared
		doesn't do it automatically ???)

I load the module with dlopen() (tried both with RTLD_NOW and _LAZY),
and it claims like:
ld.so.1: grt: fatal: relocation error: file
/home/magallon/usr/ale/lib/if/ppm.so: symbol _vt.8ofstream.3ios: referenced
symbol not found

If I declare an ofstream in the main program, it works fine.
So ofstream is not available to the shared module if I don't use one.

Any suggestion ?
Perhaps -O3 skips linking libstdc++ if I don't use streams...?
Linking xxx.o with -lstdc++ only gives me unresolveds....

Thanks in advance

-- 
Juan Antonio Magallon Lacarta             mailto:magallon@ivo.cps.unizar.es
Grupo de Informatica Grafica Avanzada             http://giga.cps.unizar.es
Tlf: 34-976-761939,1916 - Fax: 34-976-762111

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

end of thread, other threads:[~1999-04-30 23:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-20 14:24 Shared modules on Solaris+egcs Juan Antonio Magallon
1999-04-30 23:15 ` Juan Antonio Magallon

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