calling convention issue

Hello

I am facing a linking issue with a codebase compiled with PGI compilers
to a library built with Microsoft cl compiler using Visual Studio.

I am getting the following error:


io_h5file_interface.o : error LNK2019: unresolved external symbol H5check_version referenced in function io_h5init_file_


When I do:

$dumpbin.exe /SYMBOLS io_h5file_interface.o

I see the following in the output:


020 00000000 SECT1 notype () External | io_h5init_file_
021 00000000 UNDEF notype External | H5check_version


And when I check for the symbols in the library that I am trying to link to using:

$dumpbin.exe /SYMBOLS vtkhdf5.lib, I see the following in the output:


322 00001CE0 SECT6 notype () External | _H5check_version


The library has been built through CMAKE using Visual Studio 9 2008 as the generator and it uses the Microsoft cl.exe C compiler to compile.

The codebase that I am trying to link to this library has been compiled using pgcc and pgf90 PGI compilers. I think there is some name decoration problem and there is that leading underscore with the symbol in the library which is not there in the object file of the codebase.

I was looking for some ways (trying the -Miface=cref flags ) to resolve it but haven’t found it yet. Can you please suggest something to resolve this naming convention issue ?

Thanks & Regards,
Kunal

Hi Kunal,

Are you building on Win32 or Win64? What calling convention option are you giving cl.exe? (if you don’t know, please post an example cl compilation line.) Finally, what is your ‘H5_FC_FUNC’ macro set to?

  • Mat