multiple definition of 'pgf90_show_

Hello
I have a compilation probleme (ld) with the pgf90 library (libpgf90.a)
there are multiple definition of pgf90_show_', first in dbug90.o and second in dbug90. What can i do ? Tank you for your help \ \ /usr/bin/ld -Bstatic --export-dynamic -shared /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/crtbegin.o\ -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 C/Mt3d_API.o C/PyMt3d.o F90/mt3d_defdataset.o F90/mt3d_dt.o F90/mt3d_get_conc.o F90/mt3d_get_diffusion.o F90/mt3d_get_perm.o F90/mt3d_go_step.o F90/mt3d_headadaption.o F90/mt3d_initialize1.o F90/mt3d_initialize.o F90/mt3d_iterate.o F90/mt3d_run.o F90/mt3d_set_boundarycondition.o F90/mt3d_set_conc.o F90/mt3d_set_diffusion.o F90/mt3d_set_mesh.o F90/mt3d_set_porosity.o F90/mt3d_set_source.o F90/mt3d_stop.o F90/mt3d_temps.o \ --whole-archive /usr/local/PGI/current/linux86/6.1/lib/libpgf90.a --no-whole-archive /usr/local/PGI/current/linux86/6.1/lib/libpgf90_rpm1.a /usr/local/PGI/current/linux86/6.1/lib/libpgf902.a /usr/local/PGI/current/linux86/6.1/lib/libpgf90rtl.a /usr/local/PGI/current/linux86/6.1/lib/libpgftnrtl.a /usr/local/PGI/current/linux86/6.1/lib/libpgc.a /usr/local/PGI/current/linux86/6.1/lib/libpghpf.a -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2 \ ./F90/Banque/libMt3d.a -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgc -lgcc -lgcc ../../../../ALLIANCES_ROOT/ALLIANCES/src/Mt3d/F90/libpgnod_prod/libpgnod_prof.a\ \ /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/crtendS.o \ /usr/lib/crtn.o \ -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl \ -L/usr/local/PGI/current/linux86/6.1/lib\ -lnspgc -lpgc -lgcc -Bdynamic -lc -lm \ -o PyMt3d.so; \ else \ exit $status ; \ fi ; \ fi;\ fi /usr/local/PGI/current/linux86/6.1/lib/libpgf90.a(dbugf90.o)(.text+0x150): In function pgf90_show_’:
: multiple definition of pgf90_show_' /usr/local/PGI/current/linux86/6.1/lib/libpgf90.a(dbug.o)(.text+0xbe0): first defined here ld: Warning: size of symbol pgf90_show_’ changed from 330 to 407 in /usr/local/PGI/current/linux86/6.1/lib/libpgf90.a(dbugf90.o)
/usr/local/PGI/current/linux86/6.1/lib/libpgf90.a(dbugf90.o)(.text+0x150): In function pgf90_show_': : multiple definition of pgf90_show_’
/usr/local/PGI/current/linux86/6.1/lib/libpgf90.a(dbug.o)(.text+0xbe0): first defined here
/usr/bin/ld: Warning: size of symbol `pgf90_show_’ changed from 330 to 407 in /usr/local/PGI/current/linux86/6.1/lib/libpgf90.a(dbugf90.o)
make[4]: [PyMt3d.so] Error 1 (ignored)

Hi libellule,

Since you use the “–whole-archive” flag, the linker is adding all of libpgf90.a’s symbols into your application. So when it gets the the second and third instance of libpgf90 you have on the link line (-lpgf90), the linker already has a definition for “pgf90_show”. It should work if you remove the two “-lpgf90” flags.

Hope this helps,
Mat

Hi Mat,
Thank you for your answere
When , i remove the two “-lpgf90” flag, there are always a problem.
It’s only if i remove the “–whole-archive” flag, that it’s work. But there is a problem, after in the run. there are “undefined reference”.
Bye
Libellule