- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I am using Intel compilers on Windows through the cygwin environment. I am trying to link a library with my applicationbut while linking, I am getting unresolved external symbol errors similar to the following:
-----------
io_ncmpi_def_dims.o : error LNK2019: unresolved external symbol ncmpi_def_dim referenced in function io_ncmpi_def_dims_
-----------
There are 28 such unresolved external symbols. When I checked in the io_ncmpi_def_dim.o file for the symbol using : $ dumpbin.exe /SYMBOLS io_ncmpi_def_dim.o
I see this symbol as follows:
-----------
008 00000000 UNDEF notype () External | ncmpi_def_dim
-----------
When I check the same symbol in the library that I am trying to link, I see it as follows:
-----------
01B 00000000 UNDEF notype () External | _ncmpi_def_dim
-----------
So basically, there is an underscore prefix in the symbol in the library where as it is not there in the object file built by intel compilers.
Is there any compiler flags to add such underscore prefix to symbol names while building with intel C compiler ? Or any other alternative way to resolve this linking issue ?
Thanks & Regards,
Kunal
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, there are flags to control underscores; they are well documented.
The two outputs from DUMPBIN that you showed both show unsatisfied references, one with an underscore and one without.
The question remains as to where the symbol is actually defined, and what decoration is used there. It is going to be a bit harder for you to make them all work together if you have an external reference and a definition in objects or libraries for which you have no source and they have different decorations as noted above. If you have sources for everything, all you have to do is to make sure that they are consistent as to names and compile all the sources with the appropriate underscore convention.
The two outputs from DUMPBIN that you showed both show unsatisfied references, one with an underscore and one without.
The question remains as to where the symbol is actually defined, and what decoration is used there. It is going to be a bit harder for you to make them all work together if you have an external reference and a definition in objects or libraries for which you have no source and they have different decorations as noted above. If you have sources for everything, all you have to do is to make sure that they are consistent as to names and compile all the sources with the appropriate underscore convention.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please direct me to the appropriate flag with Intel C++ compiler (for Windows) to pre pend an underscore with the symbols ? I glanced through the document, but could not find it.
Thanks & Regards,
Kunal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
make sure the lib env-var containing the correct directories. For win32, make sure it contains the wn32 dirs, for x64, it should contain x64 dirs.
you can use "xilink /verbose:lib" to display the directories searched.
Jennifer
you can use "xilink /verbose:lib" to display the directories searched.
Jennifer
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page