Problem with Hdfql and visual studio 2015 or 2019

Hello,

I’m posting a message here because I’m having problems coding with HDFql in fortran90 on Visual Studio 2015 and 2019

Problem I’m getting on Visual Studio 2019 with last HDFql release (2.4.0) on windows 10:
Using static library:
I can create file, dataset fine,read them in hdfview, but if I try to read the cursor, or a file (even if I just copy hdfql examples), I get the equivalent of a segmentation fault (Access violation).
Basically I can open h5 file, write them, but not read from them.

On the reference manual I did read “When compiling a program against the HDFql Fortran static library in Windows, the subroutines “hdfql_initialize” and “hdfql_finalize” must be explicitly called by the program when starting and finishing respectively (otherwise an error may occur suchas a segmentation fault).”

so I tried adding “CALL hdfql_initialize()” at the start of my file (the subroutine is detected) but then I directly get an access violation and can’t go further in the code (not even creating a file)

using shared library:
No symbol are recognized, even though I added the correct folder in Fortran->general->additional library and in linker->general->additionnal directory + linker->input->HDFql_dll.lib

Problem I’m getting on Visual Studio 2015 with last HDFql release (2.4.0) on windows 10:
using static or shared library:
When I try building my project using HDFQL (So only if I put “USE HDFql” at the start of my file), I get a “fatal error LNK1171: unable to load c2.dll (error code: 126)” and can’t go any further.

I’m sorry this post is very long, but I’m really in need for help

Best regards,

Hi @angelbillyguyon,

Since you are working in Windows, would you mind to tell which version of IFORT are you using?

Thanks!

Hello,

I’m using the last IFORT version, but I finally managed to get it working in shared library.

My guess: I was lacking some component on visual studio 2015 (mainly compiler) hence why the c2.dll not loaded

When it comes to visual studio 2019, static library probably is not working correctly because HDFql is compiled with VS2015, and for shared library what I forgot was to put HDFql_dll.dll inside the output folder of my project (where the .exe is created), once I did it tadam it worked

tl:dr : solution was to put the dll file inside the output folder (Path variable didn’t work)

I have another question related to HDFql but I think it’s a bit out related so I will create another topic

Thanks for your answer

1 Like

Hi again @angelbillyguyon,

Great to know that you managed to solve the issue!