This might be a little QT specific, but here we go...
I've got a QT app that I need to interface with a couple of external libraries written in C. Everything seems to be working, as I can link correctly, but when I try and call any function in one of the libraries I always get an access violation error. For the other library, I call like 10 functions in my process, but the 11th one gives me the same thing. I'll give the specifics for the first one here since I think it should be more obvious what's wrong.
The library comes with a .lib, .h, and installs a .dll to system32. Here's a function declaration from the .h: __declspec(dllimport) unsigned short InPortB(unsigned long Port);
The library comes with a digital IO card that you use this function to write data to. Port is the address of the card. I know that the address is 0xdeb0 and I can verify that writing to this address is valid because the sample code I got with the card does that without errors. The sample code I get is a C++ VS2005 solution. I can build it and everything is fine. When I try and copy the sample code into my QT app, I get the access violation.
So, I first thought there was a mismatch with calling conventions, but I don't see how the application would link if that was the case.
I just looked at my app's exe in depends and it's a little strange. It looks like my application isn't actually calling any of the functions in the external library. Also, when I view the debug output from the windows error message, I don't see the DLL loaded anywhere.
Do I have to manually load a dll? I don't have to do anything about the dll when running the visual studio project, so that doesn't make sense to me. I'm pretty lost here.