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

c++ compiler error on link

abinitiomd
Beginner
600 Views
Hi folks.
I got some errors beyond my knowledge.
I was compiling my C++ program with 8.0 version.
This could be compiled with 7.0.
Most of errors are complaining that they cannotto find "Locksyslock" or "Unlocksyslock". Do you have any idea or have same experience as me?
Please give me some hints.
The error is following.
../Intelopt/libsim.a(simprog.o): In function `std::num_get > > const& std::use_facet<:NUM_GET> > > >(std::locale const&)':
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEEERKT_RKSt6locale+0x27): undefined reference to `std::_Locksyslock(int)'
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEEERKT_RKSt6locale+0x4d): undefined reference to `std::_Unlocksyslock(int)'
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEEERKT_RKSt6locale+0x98): undefined reference to `std::_Locksyslock(int)'
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEEERKT_RKSt6locale+0xb2): undefined reference to `std::_Unlocksyslock(int)'
../Intelopt/libsim.a(simprog.o): In function `std::numpunct const& std::use_facet<:NUMPUNCT> >(std::locale const&)':
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt8numpunctIcEERKT_RKSt6locale+0x2a): undefined reference to `std::_Locksyslock(int)'
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt8numpunctIcEERKT_RKSt6locale+0x50): undefined reference to `std::_Unlocksyslock(int)'
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt8numpunctIcEERKT_RKSt6locale+0x9b): undefined reference to `std::_Locksyslock(int)'
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt8numpunctIcEERKT_RKSt6locale+0xb5): undefined reference to `std::_Unlocksyslock(int)'
../Intelopt/libsim.a(simprog.o): In function `std::num_put > > const& std::use_facet<:NUM_PUT> > > >(std::locale const&)':
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEEERKT_RKSt6locale+0x27): undefined reference to `std::_Locksyslock(int)'
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEEERKT_RKSt6locale+0x4d): undefined reference to `std::_Unlocksyslock(int)'
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEEERKT_RKSt6locale+0x98): undefined reference to `std::_Locksyslock(int)'
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEEERKT_RKSt6locale+0xb2): undefined reference to `std::_Unlocksyslock(int)'
../Intelopt/libsim.a(simprog.o): In function `std::ctype const& std::use_facet<:CTYPE> >(std::locale const&)':
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale+0x2a): undefined reference to `std::_Locksyslock(int)'
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale+0x50): undefined reference to `std::_Unlocksyslock(int)'
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale+0x9b): undefined reference to `std::_Locks yslock(int)'
simprog.o(.gnu.linkonce.t._ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale+0xb5): undefined reference to `std::_Unlocksyslock(int)'
../Intelopt/libsim.a(simprog.o): In function `std::_Lockit::~_Lockit [in-charge]()':
simprog.o(.gnu.linkonce.t._ZNSt7_LockitD1Ev+0xb): undefined reference to `std::_Unlocksyslock(int)'
../Intelopt/libsim.a(out.o): In function `std::codecvt const& std::use_facet<:CODECVT> >(std::locale const&)':
out.o(.gnu.linkonce.t._ZSt9use_facetISt7codecvtIcc11__mbstate_tEERKT_RKSt6locale+0x27): undefined reference to `std::_Locksyslock(int)'
out.o(.gnu.linkonce.t._ZSt9use_facetISt7codecvtIcc11__mbstate_tEERKT_RKSt6locale+0x4d): undefined reference to `std::_Unlocksyslock(int)'
out.o(.gnu.linkonce.t._ZSt9use_facetISt7codecvtIcc11__mbstate_tEERKT_RKSt6locale+0x98): undefined reference to `std::_Locksyslock(int)'
out.o(.gnu.linkonce.t._ZSt9use_facetISt7codecvtIcc11__mbstate_tEERKT_RKSt6locale+0xb2): undefined reference to `std::_Unlocksyslock(int)'
m
0 Kudos
3 Replies
cp_jain
Beginner
600 Views
Hi,

Even I had faced similar problem. I found that my program was linking libs from /opt/intel_fc_80/lib instead of
/opt/intel_cc_80/lib and I am having different sub-versions of fortran and C++ compiler.

std::_Locksyslock(int) is defined in libcprts.so

do ldd "executablefile" to make sure that you are linking correct libs.

Hope this will help,
CP
0 Kudos
abinitiomd
Beginner
600 Views
Hi CP!
You are right.
Wehave intel fortan and c++ compilersinstalled in two different directories. Because my program ismixed withfortran and C++, I had to "source" two different environment scripts. Unfortunately, fortran and C++ compiler share the same library filename andlinker seems to link with fortran library.
Anyway, Thank you so much.
BC
0 Kudos
cp_jain
Beginner
600 Views
Hi

I want to clarify something on this problem -

you can have both C++ and fortran compiler installed. Libs with same name in both the places should be same if you have the latest versions of both these compilers.

cp
0 Kudos
Reply