Unresolved external symbol XLength_error

Unresolved external symbol XLength_error

Hello

I'm having an issue to link my static library built in intel compiler. The situation is this.
I have static library built in VS2010 with "intel compiler 2013 SP1" . (.icproj converted from older VS2005 to VS2010).
Static library is built correctly without any error . But I get these warning

Warning 1 warning #10148: option '/Qopenmp-link:static' not supported C:\innovatrics\iengine\iengineStatic\iengineStatic_2005\icl

From what I understand these warnings should be connected to my issue.

After static library is built I try to link it with project within VS2005.

just to be clear (VS2005 VC++ dll is linking 2010 static lib compiled with intel compiler).
When compiler is trying to link static lib i get this error

Error 9 error LNK2001: unresolved external symbol "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z) xxxx.lib
I found out that it is not possible to link VS2010 lib into VS2005 program,
but this shouldn't be issue with intel compiler,should it?

When I compile my static lib in VS2005 with intel compiler 2011 and i try to link it to the same DLL project
everything is fine. No unresolved external symbol error.

Is there any possibility to get it working? I'm kind a desperate

Thanks for your help
Martin Slavkovsky

 

 

 

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello,

I speculate that you are building these libs in Release mode ,please check that all you libs' Runtime Library option should be set to Multi-threaded (/MT) .

 

Thanks,

-- QIAOMIN.Q

Intel Developer Support

 

Hi,

     The "/Qopemp-link:static" option is deprecated and is not suggested to be used. Please refer to compiler user and reference guide.

Regarding the second issue "undefined refernce", This link time error happens usually provided the symbols [ ?_Xlength_error@std@@YAXPBD@Z -- IN YOUR CASE] is not found in "xxxx.lib".

You may cross check this :-

1. dumpbin /SYMBOLS xxxx.lib > out.txt

2. Search in out.txt whether can you find this symbol "?_Xlength_error@std@@YAXPBD@Z".

If not, then you may need to add the obj which would contain this symbol. In fact the way to find this is :-

Since you are creating this static lib "xxxx.lib", Try searching where have you implemented the function "Xlength_error(char const *)", I mean in which cpp file and recreate your xxxx.lib with that obj.

Please do let us know if you need any further help.

Regards,

Sukruth H V

 

Hi,

I understand what the /Qopemp-link:static means. I know I shoudln't use libiomp5mt.lib anymore.
I tried to experiment with changing intel libs for my static xxx.lib.
Anyway I'm using libirc.lib, libdecimal.lib, libiom5md.lib ,
I even got rid of libiom5mt.lib from my project.

Didn't help. So I don't think my issue is connected to openmp lib.

Regarding runtime library I use the static one /MT. In my xxx.lib also in dll which links xxx.lib.

After i used Dumpbin on xxx.lib compiled on VS2005(IntelComp 2011) and VS2010(IntelComp 2005) I go these results.

In VS2010 I found these lines

14D 00000000 UNDEF notype () External | _memmove
14E 00000000 UNDEF notype () External | ??0exception@std@@QAE@ABQBD@Z (public: __thiscall std::exception::exception(char const * const &))
14F 00000000 UNDEF notype () External | __CxxThrowException@8
150 00000000 UNDEF notype () External | ?_Xlength_error@std@@YAXPBD@Z (void __cdecl std::_Xlength_error(char const *))
151 00000000 SECT47 notype Static | .text

This can be found few times in dumpbin output.

On VS2005 (IntelComp 2011)
there is no such symbol as _Xlength_error in dumpbin output.
I think this is somehow connected to c++ std library? Is it possible to have a conflict
between different sdt system libs?

I think we are talking about this class http://www.cplusplus.com/reference/stdexcept/length_error/.
So this class should be defined by std library not by me

Thanks
Martin

sorry for duplicate

Can you make sure that if your lib path is pointing at a right C Runtime Library version ?To check that go to Tools->Options->Projects->VC++ Directories->Library files ,also maybe you can try add #include<stdexcept> explicitly in your code?  it seems the searching path for C++ standard library can't be located.

Leave a Comment

Please sign in to add a comment. Not a member? Join today