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

cpu_feature_disp.c:(.text+0x4aca88): undefined reference to `getenv' and `__errno_location'

yangjunl
Employee
1,524 Views

In my project, I need to use the library icc/compiler/lib/intel64_lin/libirc.a, But when link it, then appear link error:

 

ld.bfd: module.o: in function `__intel_cpu_features_init_body':
cpu_feature_disp.c:(.text+0x4aca88): undefined reference to `getenv'
ld.bfd: cpu_feature_disp.c:(.text+0x4aca90): undefined reference to `__errno_location'

 

I find the symbol in glibc, but I want to know whether the library libirc.a depend on glibc?

The version icc is show attached picture.

0 Kudos
1 Solution
SantoshY_Intel
Moderator
1,230 Views

Hi,

 

>>"I want to know whether the library libirc.a depend on glibc?"

The Intel® C++ Compiler Classic supplies additional libraries(include the Intel® Math Library (libimf), the Short Vector Math Library (libsvml), libirc, as well as others) that contain optimized implementations of many commonly used functions. These libraries are linked in by default.

 

Intel® C++ Compiler Classic System Requirements says that GLIBC version - 2.17 - 20.33 is needed.

 

So, libirc depends on GLIBC.

 

Could you please confirm whether to keep the thread open or close for the time being? You can post a new thread once you have the sample scenario ready.

 

Thanks & Regards,

Santosh

 

 

View solution in original post

0 Kudos
5 Replies
SantoshY_Intel
Moderator
1,395 Views

Hi,


Thanks for reaching out to us.


Could you please provide us with the below details?

  1. The operating system and its version.
  2. A sample reproducer code.
  3. Steps to reproduce your issue with the commands being used for linking.
  4. Is the Base Toolkit installed on your machine?


>>"I find the symbol in glibc"

Could you please let us know how you find the symbol in glibc?


Thanks & Regards,

Santosh




0 Kudos
SantoshY_Intel
Moderator
1,267 Views

Hi,


We haven't heard back from you. Could you please provide the above-requested details to investigate more on your issue?


Thanks & Regards,

Santosh


0 Kudos
yangjunl
Employee
1,253 Views

Hi, thanks for your reply, because the project is confidential, so I can't give the scenario directly. But I will try to make a similar scenario by my self later, and then reply you again.

0 Kudos
SantoshY_Intel
Moderator
1,231 Views

Hi,

 

>>"I want to know whether the library libirc.a depend on glibc?"

The Intel® C++ Compiler Classic supplies additional libraries(include the Intel® Math Library (libimf), the Short Vector Math Library (libsvml), libirc, as well as others) that contain optimized implementations of many commonly used functions. These libraries are linked in by default.

 

Intel® C++ Compiler Classic System Requirements says that GLIBC version - 2.17 - 20.33 is needed.

 

So, libirc depends on GLIBC.

 

Could you please confirm whether to keep the thread open or close for the time being? You can post a new thread once you have the sample scenario ready.

 

Thanks & Regards,

Santosh

 

 

0 Kudos
SantoshY_Intel
Moderator
1,175 Views

Hi,


Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Santosh


0 Kudos
Reply