Linker error 2019

I use the latest pgcpp under cygwin.

After successful compilation I get the following messages from the linker:

mriseg.obj : error LNK2019: unresolved external symbol _max__12Opt__tm__2_f referenced in function _Add__12Opt__tm__2_fSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol _min__12Opt__tm__2_f referenced in function _Add__12Opt__tm__2_fSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol _max__13Opt__tm__3_Uc referenced in function _Add__13Opt__tm__3_UcSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol _min__13Opt__tm__3_Uc referenced in function _Add__13Opt__tm__3_UcSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol _max__12Opt__tm__2_s referenced in function _Add__12Opt__tm__2_sSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol _min__12Opt__tm__2_s referenced in function _Add__12Opt__tm__2_sSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol _max__13Opt__tm__3_Us referenced in function _Add__13Opt__tm__3_UsSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol _min__13Opt__tm__3_Us referenced in function _Add__13Opt__tm__3_UsSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol _max__12Opt__tm__2_d referenced in function _Add__12Opt__tm__2_dSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol _min__12Opt__tm__2_d referenced in function _Add__12Opt__tm__2_dSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol _max__12Opt__tm__2_i referenced in function _Add__12Opt__tm__2_iSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol _min__12Opt__tm__2_i referenced in function _Add__12Opt__tm__2_iSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol _max__28Opt__tm__17_14ZRGB__tm__3_Uc referenced in function ___sti___10_mriseg_cpp_bad592fd
mriseg.obj : error LNK2019: unresolved external symbol _min__28Opt__tm__17_14ZRGB__tm__3_Uc referenced in function ___sti___10_mriseg_cpp_bad592fd
mriseg.obj : error LNK2019: unresolved external symbol _max__27Opt__tm__16_13ZRGB__tm__2_s referenced in function ___sti___10_mriseg_cpp_bad592fd
mriseg.obj : error LNK2019: unresolved external symbol _min__27Opt__tm__16_13ZRGB__tm__2_s referenced in function ___sti___10_mriseg_cpp_bad592fd
mriseg.obj : error LNK2019: unresolved external symbol _max__27Opt__tm__16_13ZRGB__tm__2_f referenced in function ___sti___10_mriseg_cpp_bad592fd
mriseg.obj : error LNK2019: unresolved external symbol _min__27Opt__tm__16_13ZRGB__tm__2_f referenced in function ___sti___10_mriseg_cpp_bad592fd
mriseg.obj : error LNK2019: unresolved external symbol _max__28Opt__tm__17_14ZRGB__tm__3_Us referenced in function ___sti___10_mriseg_cpp_bad592fd
mriseg.obj : error LNK2019: unresolved external symbol _min__28Opt__tm__17_14ZRGB__tm__3_Us referenced in function ___sti___10_mriseg_cpp_bad592fd
C:\temp/pgcpp2apGobTbfJtDEe.exe : fatal error LNK1120: 20 unresolved externals


Is there any way to find out where these are coming from or to locate the calling functions given by the linker?

thank you

a_bra

Hi a_bra,

These are all C++ mangled names which can be decoded using “pgdecode”.

PGI$ pgdecode
mriseg.obj : error LNK2019: unresolved external symbol _max__12Opt__tm__2_f referenced in function _Add__12Opt__tm__2_fSFRCfT1_Z1Z
mriseg.obj : error LNK2019: unresolved external symbol Opt<T1>::_max [with T1=float] referenced in function T1 Opt<T1>::_Add(const float &, const float &) [with T1=float]

mriseg.obj : error LNK2019: unresolved external symbol _min__12Opt__tm__2_f referenced in function _Add__12Opt__tm__2_fSFRCfT1_Z1Z 
mriseg.obj : error LNK2019: unresolved external symbol Opt<T1>::_min [with T1=float] referenced in function T1 Opt<T1>::_Add(const float &, const float &) [with T1=float]

Note, you can also pipe the names instead of coping them over, i.e. “cat err.log | pgdecode”.

So the linker is complaining that the ‘mriseg’ object contains a function called ‘_Add’, from the ‘Opt’ template, which uses the unresolved external symbols “_min” and “_max”.

  • Mat

Hi Mat

This was very helpful.
I finally made it-- porting from linux to cygwin. the test runs are promising. The only thing still missing is C99 support for some of the programs. But this is no problem at the moment.

I want to thank all for the help

a_bra