Open Source Development

 View Only

 linker error

John Parke's profile image
John Parke posted Mon March 16, 2026 08:28 AM

I am building a system using gcc version 13.3.0 (GCC), on AIX 7.2. I am getting the following linker error, which I don't know how to fix. Any help would be greatly appreciated. 

John

RESOLVE: 71355 of 331222 symbols were kept.
RESOLVE: The return code is 4.
(ld): addgl /usr/lib/glinkl.o
ADDGL: Glink code added for 794 symbols.
(ld): er full
ld: 0711-407 ERROR: Symbol ._ZNKSt23__codecvt_abstract_baseIwcPcE2inERS0_PKcS4_RS4_PwS6_RS6_
Visibility is not allowed on a reference to an imported symbol.
ld: 0711-407 ERROR: Symbol ._ZNKSt23__codecvt_abstract_baseIwcPcE2inERS0_PKcS4_RS4_PwS6_RS6_
Visibility is not allowed on a reference to an imported symbol.
ld: 0711-407 ERROR: Symbol ._ZNKSt23__codecvt_abstract_baseIwcPcE3outERS0_PKwS4_RS4_S0_S0_S2_
Visibility is not allowed on a reference to an imported symbol.
ld: 0711-407 ERROR: Symbol ._ZNKSt23__codecvt_abstract_baseIwcPcE3outERS0_PKwS4_RS4_S0_S0_S2_
Visibility is not allowed on a reference to an imported symbol.
ld: 0711-407 ERROR: Symbol _ZNKSt23__codecvt_abstract_baseIwcPcE2inERS0_PKcS4_RS4_PwS6_RS6_
Visibility is not allowed on a reference to an imported symbol.
ld: 0711-407 ERROR: Symbol _ZNKSt23__codecvt_abstract_baseIwcPcE2inERS0_PKcS4_RS4_PwS6_RS6_
Visibility is not allowed on a reference to an imported symbol.
ld: 0711-407 ERROR: Symbol _ZNKSt23__codecvt_abstract_baseIwcPcE3outERS0_PKwS4_RS4_S0_S0_S2_
Visibility is not allowed on a reference to an imported symbol.
ld: 0711-407 ERROR: Symbol _ZNKSt23__codecvt_abstract_baseIwcPcE3outERS0_PKwS4_RS4_S0_S0_S2_
Visibility is not allowed on a reference to an imported symbol.
ER: The return code is 8.
collect2: error: ld returned 8 exit status
gmake: *** [/usr/pdm7_0r1/pdm7_1r0/MakeStuff/Make.sys:131: dmeacct] Error 1
gmake: Leaving directory '/usr/pdm7_0r1/pdm7_1r0/src/dmeacct'
Ayappan P's profile image
Ayappan P

Can you paste the actual compilation command that is failing with this error ? 

John Parke's profile image
John Parke

I figure this out. I was using these linker options:
LDFLAGS+=-Wl,-b32,-m,-bbigtoc,-bnoquiet \
-lrt -lz \
/opt/freeware/lib/libxml2.a /opt/freeware/lib/libz.a \
/opt/freeware/lib/libiconv.a \
/opt/freeware/lib/liblzma.a \
/usr/local/lib/libhwloc.a \
/usr/local/lib/libreplxx.a \
/usr/local/lib/libbotan-3.a \
/opt/freeware/lib/libbz2.a \
/opt/freeware/lib/libreadline.a \
/opt/freeware/lib/libhistory.a \
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/$(GCC_VERSION)/pthread/libstdc++.a \  <----- removing this fixed the problem.
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/$(GCC_VERSION)/pthread/libatomic.a \
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/$(GCC_VERSION)/pthread/libgcc.a \
-pthread