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

Link error

Victor_V_2
Beginner
661 Views

Hello,
I try to build application with OpenCascade 6.52, Qt 3.37 and boost 1.38 libraries.
I have link error:
ld: /tmp/my_app: hidden symbol `atexit' in /usr/lib64/libc_nonshared.a(atexit.oS) is referenced by DSO
ld: final link failed: Nonrepresentable section on output
I use CentOS 6.3, Intel compiler v.10.1. My program successfully compiles and links on CentOS v.4.
Does anybody know what may cause this error?
May be there's incompatibility libc (of this version of CentOS) and Intel compiler v.10.1?

Thanks

0 Kudos
5 Replies
TimP
Honored Contributor III
661 Views

You've probably noticed that this error is encountered by others who don't use Intel compilers but have forced the linking with libc_nonshared.  Presumably, you would not see this problem if you linked with the default shared libc.  CentOS 6 deprecates support for static libraries, and your difficulty in attempting to combine shared and non-shared libraries is not unique.  It potentially takes you beyond the bounds where you can count on the support of an older icc under a much earlier version of Red Hat will avoid difficulties under a recent OS.

If you can find a support forum for those particular applications, you might ask whether they have a recipe for linking with nonshared on CentOS (even with gcc).

0 Kudos
SergeyKostrov
Valued Contributor II
661 Views
>>I have link error: >>ld: /tmp/my_app: hidden symbol `atexit' in /usr/lib64/libc_nonshared.a(atexit.oS) is referenced by DSO >>... - Possible reason what the linker error - it looks like some library is not used in your make file - It is not clear what a DSO is? - Some details about atexit - it allows to set a function which will be invoked when the application exits ( ignore explanation if you know what atexit does )
0 Kudos
Victor_V_2
Beginner
661 Views

Hello, Tim, Sergey,

Thanks for your comments.

TimP (Intel) wrote:

You've probably noticed that this error is encountered by others who don't use Intel compilers but have forced the linking with libc_nonshared.  Presumably, you would not see this problem if you linked with the default shared libc.

Can you, please tell, if I link my app using icc or icpc, how it links standard libraries (e.g. libc) by default (statically or dynamically or icc does not link it at all)? How can I control the way libc is linked explicitly? Should I use "-Bstatic -lc" and "-Bdynamic -lc" for this?

TimP (Intel) wrote:

CentOS 6 deprecates support for static libraries, and your difficulty in attempting to combine shared and non-shared libraries is not unique.

How did you know, that the problem is with mixing statically and dynamically linked libraries? (I'm just curious) Actually I'm not sure about this, because some libraries were compiled by other people, and I'm not sure about link options.

TimP (Intel) wrote:

It potentially takes you beyond the bounds where you can count on the support of an older icc under a much earlier version of Red Hat will avoid difficulties under a recent OS.

If you can find a support forum for those particular applications, you might ask whether they have a recipe for linking with nonshared on CentOS (even with gcc).

Sorry, I did not get the meaning of the first phrase in the above quote. Can you, please, repeate it in other words.

I've seen, that other people have the same problem with other applications (indeed not related to icc), but in all places the walkaround was to supply some additional option to "configure" scripts. I do not even know, how it influence the linkage options. So, not so much help there.

-------------------------------------------------------------

Sergey Kostrov wrote:

>>I have link error:
>>ld: /tmp/my_app: hidden symbol `atexit' in /usr/lib64/libc_nonshared.a(atexit.oS) is referenced by DSO
>>...

- Possible reason what the linker error - it looks like some library is not used in your make file

Do you mean, that I miss some library in the list of libs being linked? Others (including Tim - see above) say, that the problem is related to libc, do you think it may be about other library? If yes, can you explain the mechanism?

Sergey Kostrov wrote:

- It is not clear what a DSO is?

Actually, for me too. But it seems, that it is some standard thing, as google finds same problem (either with DSO) met by other people building other apps. But if anybody can explain, what is DSO (or give some reference), I would appreciate it.

Thanks again for your support.

0 Kudos
TimP
Honored Contributor III
661 Views

The compilers proceed to a link step unless you have set an option which changes the default (e.g. -c stops before link step).

If you don't specifically request static libraries, the linker will choose dynamic libraries to the extent available.

If you look at the version notes in your compiler installation (or simply consider the release dates) you will see that older compiler versions haven't been tested on current linux distros (aren't "supported").   In your case, it seems unlikely that the build command itself was tested on your current linux version.

0 Kudos
SergeyKostrov
Valued Contributor II
661 Views
>>>>- Possible reason what the linker error - it looks like some library is not used in your make file >> >>Do you mean, that I miss some library in the list of libs being linked? Yes and I suggest you to do the following: - Check the docs with description of C Run-Time ( CRT ) functions since they should provide information on header files and library names ( for example, MSDN does it ) - Search for a substring atexit in all *.a-files ( Note: possibly it could be in a libgcc.a library )
0 Kudos
Reply