Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7943 Discussions

LNK2001 error with strange numbered member function names in symbols.

JAVIER_D_
Beginner
496 Views

Hi.

We are trying to migrate our software from VS2005 to Intel C++ Compiler 9.1, but so far we're finding some issues with linking.

The code compiles and links fine with VS, but fails linking when using ICC with errors like the ones attached at the end of the post.

Actually, the module we're linking is configured to link to some other modules that have been already compiled and linked, and that already exports the missing symbols, with the only difference that the exported symbols do not contain the numbering after the member function names. For instance:
  • Symbol reported as "unresolved":
    • ?get_FamilyID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
  • Symbol exported by the library the module links against:
    • ?get_FamilyID@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ

We don't know why we are getting mismatches like these in several modules, so...

Does anyone know what these "numbers" (".99") at the end of the member function symbol names are?

Can anyone offer us any hint on how to solve this issue?


Thanks in advance,

maquiles.



1>ipo_4566obj.obj : error LNK2001: unresolved external symbol "?get_FamilyID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ" (?get_FamilyID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>ipo_4566obj1.obj : error LNK2001: unresolved external symbol "?get_FamilyID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ" (?get_FamilyID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>ipo_4566obj2.obj : error LNK2001: unresolved external symbol "?get_FamilyID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ" (?get_FamilyID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>ipo_4566obj.obj : error LNK2001: unresolved external symbol "?get_ID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ" (?get_ID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>ipo_4566obj1.obj : error LNK2001: unresolved external symbol "?get_ID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ" (?get_ID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>ipo_4566obj2.obj : error LNK2001: unresolved external symbol "?get_ID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ" (?get_ID.99@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>ipo_4566obj.obj : error LNK2001: unresolved external symbol "?Output.99@FOLClassType@@UAEXAAVFOLResultContainer@@@Z" (?Output.99@FOLClassType@@UAEXAAVFOLResultContainer@@@Z)
1>ipo_4566obj1.obj : error LNK2001: unresolved external symbol "?Output.99@FOLClassType@@UAEXAAVFOLResultContainer@@@Z" (?Output.99@FOLClassType@@UAEXAAVFOLResultContainer@@@Z)
1>ipo_4566obj2.obj : error LNK2001: unresolved external symbol "?Output.99@FOLClassType@@UAEXAAVFOLResultContainer@@@Z" (?Output.99@FOLClassType@@UAEXAAVFOLResultCo
ntainer@@@Z)
1>ipo_4566obj.obj : error LNK2001: unresolved external symbol "?get_FamilyID.102@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ" (?get_FamilyID.102@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>ipo_4566obj1.obj : error LNK2001: unresolved external symbol "?get_FamilyID.102@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ" (?get_FamilyID.102@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>ipo_4566obj2.obj : error LNK2001: unresolved external symbol "?get_FamilyID.102@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ" (?get_FamilyID.102@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>ipo_4566obj.obj : error LNK2001: unresolved external symbol "?get_ID.102@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ" (?get_ID.102@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>ipo_4566obj1.obj : error LNK2001: unresolved external symbol "?get_ID.102@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ" (?get_ID.102@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>ipo_4566obj2.obj : error LNK2001: unresolved external symbol "?get_ID.102@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ" (?get_ID.102@FOLClassType@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>ipo_4566obj.obj : error LNK2001: unresolved external symbol "?Output.102@FOLClassType@@UAEXAAVFOLResultContainer@@@Z" (?Output.102@FOLClassType@@UAEXAAVFOLResultContainer@@@Z)
1>ipo_4566obj1.obj : error LNK2001: unresolved external symbol "?Output.102@FOLClassType@@UAEXAAVFOLResultContainer@@@Z" (?Output.102@FOLClassType@@UAEXAAVFOLResultContainer@@@Z)
1>ipo_4566obj2.obj : error LNK2001: unresolved external symbol "?Output.102@FOLClassType@@UAEXAAVFOLResultContainer@@@Z" (?Output.102@FOLClassType@@UAEXAAVFOLResultContainer@@@Z)

0 Kudos
6 Replies
JenniferJ
Moderator
496 Views

This issue seems familiar.

Could you upgrade the IntelC to 10.0.027? you can download it from "https://registrationcenter.intel.com/RegCenter/Register.aspx" if your support service is not expired.

0 Kudos
JAVIER_D_
Beginner
496 Views
After some time we've revisited this issue, and it's still happening, even with release 10.1.020:

1>ipo_40166obj.obj : error LNK2001: unresolved external symbol "?create.74@?$factory_1_param@PAVCClObject@@V?$basic_stri
ng@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$$CBV23@VCClObjectFactory@@@bbva@@UBEPAVCClObject@@ABV?$basic_string@DU
?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z" (?create.74@?$factory_1_param@PAVCClObject@@V?$basic_string@DU?$char_tra
its@D@std@@V?$allocator@D@2@@std@@$$CBV23@VCClObjectFactory@@@bbva@@UBEPAVCClObject@@ABV?$basic_string@DU?$char_traits@D
@std@@V?$allocator@D@2@@std@@@Z)
1>ipo_40166obj.obj : error LNK2001: unresolved external symbol "?check_can_create.74@?$factory_1_param@PAVCClObject@@V?$
basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$$CBV23@VCClObjectFactory@@@bbva@@UBEXABV?$basic_string@DU?$c
har_traits@D@std@@V?$allocator@D@2@@std@@@Z" (?check_can_create.74@?$factory_1_param@PAVCClObject@@V?$basic_string@DU?$c
har_traits@D@std@@V?$allocator@D@2@@std@@$$CBV23@VCClObjectFactory@@@bbva@@UBEXABV?$basic_string@DU?$char_traits@D@std@@
V?$allocator@D@2@@std@@@Z)
1>Release/lib_NPT_BBVALMM.dll : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://X:dev
esMurexMurexIRBBVALMMReleaseBuildLog.htm"
1>BBVALMM - 3 error(s), 1 warning(s)

I've looked at the DLL where the symbol should be defined, and it's there...

?check_can_create@?$factory_1_param@PAVCClObject@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$$CBV23@VCClObjectFactory@@@bbva@@UBEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z

... only without the numeral.


I don't know what's going on, but this issue is definitely preventing us from migrating several important pieces of code to the Intel C++ compiler.


Any help?

Thanks in advance,

JJ.


0 Kudos
JenniferJ
Moderator
496 Views

So the .dll is not compiled with icl. could you try without /GL option? can you create a testcase for this?

Thanks!

0 Kudos
JAVIER_D_
Beginner
496 Views
Uhm... both the DLL exporting the symbol and client DLL that isn't able to link / import it ARE compiled with icl via a VS2005 solution/project file and invoked with devenv.exe command line.

I don't know what to do in order to prepare a test case. The two error listings of the previous posts are actually from two different "project sets".

The only thing that they seem to have in common is that all the methods failing are virtual methods with definitions in the header file:
  • FOLClassType:
    • get_FamilyID() inline virtual const with out-of-class-declaration body.
    • get_ID() inline virtual const with out-of-class-declaration body.
    • Output() virtual with in-class-declaration empty body.
  • bbva::factory_1_param:
    • create() virtual const with in-class-declaration empty body.
    • check_can_create() virtual const with in-class-declaration empty body.
Apart from that the problem must be related to some random factor in whole program optimization; for the second case, we have a second client DLL that uses the exported symbols that links correctly.

In the second case, the methods create() and check_can_create() are exported by a class hierarchy like this:

singleton_base (dllexport in implementing library, dllimport in client)
^
|
singleton (template class, non-dll{ex,im}port)
^
|
factory_1_param (template class, non-dll{ex,im}port)
^ (this is the one defining the problem methods)
|
FactoryX (dllexport in implementing library, dllimport in client)

In the first case, we don't even have any template involved:


FOLSerializable (dllexport in implementing library, dllimport in client)
^
|
FOLClassType (dllexport in implementing library, dllimport in client)
(this is the one defining the problem methods)

I don't know even how to concoct a test case, short of sending the whole project sources, which I think will be a problem. Probably the issue will manifest only on large whole-program-optimization compilations.

As you suggest, we'll try recompiling without /GL activated for the library having the problem, so that we can confirm WPO to be the one to blame.

Do you have any suggestion on how to proceed to extract a test case?


Regards, and thanks in advance,

JJ.





0 Kudos
JAVIER_D_
Beginner
496 Views
Hi again.

Actually we were using a manually specified /Qipo in the project extra command-line options box, that was implying /GL automatically.

I removed /Qipo from the problematic project and it linked OK.

A further client DLL project in our build process failed then, with the same symbols as the problem, but with different "numbers";

1>Linking... (Intel C++ Environment)
1>ipo: remark #11000: performing multi-file optimizations
1>ipo: remark #11005: generating object file ipo_25046obj.obj
1>xilink: executing 'link'
1> Creating library Release/lib_NPT_BBVAGrid.lib and object Release/lib_NPT_BBVAGrid.exp
1>ipo_25046obj.obj : error LNK2001: unresolved external symbol "?create.36@?$factory_1_param@PAVCClObject@@V?$basic_stri
ng@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$$CBV23@VCClObjectFactory@@@bbva@@UBEPAVCClObject@@ABV?$basic_string@DU
?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z" (?create.36@?$factory_1_param@PAVCClObject@@V?$basic_string@DU?$char_tra
its@D@std@@V?$allocator@D@2@@std@@$$CBV23@VCClObjectFactory@@@bbva@@UBEPAVCClObject@@ABV?$basic_string@DU?$char_traits@D
@std@@V?$allocator@D@2@@std@@@Z)
1>ipo_25046obj.obj : error LNK2001: unresolved external symbol "?check_can_create.36@?$factory_1_param@PAVCClObject@@V?$
basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$$CBV23@VCClObjectFactory@@@bbva@@UBEXABV?$basic_string@DU?$c
har_traits@D@std@@V?$allocator@D@2@@std@@@Z" (?check_can_create.36@?$factory_1_param@PAVCClObject@@V?$basic_string@DU?$c
har_traits@D@std@@V?$allocator@D@2@@std@@$$CBV23@VCClObjectFactory@@@bbva@@UBEXABV?$basic_string@DU?$char_traits@D@std@@
V?$allocator@D@2@@std@@@Z)
1>Release/lib_NPT_BBVAGrid.dll : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://X:dev
esMurexBBVAClusterBBVAGridReleaseBuildLog.htm"
1>BBVAGrid - 3 error(s), 8 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



0 Kudos
JAVIER_D_
Beginner
496 Views
I've opened an issue (#472227) at Intel Premier Support about this problem.
0 Kudos
Reply