PDA

View Full Version : Can't access dll



waynew
15th November 2010, 01:54
I really need to get this solved and would appreciate any help someone can give me.

I have tried in various ways to use this external library (tqsllib2.dll, compiled with Mingw) with no success.

Here is the latest attempt.

(I have included the library .h in my application header file}

My pro file looks like this:


INCLUDEPATH += C:\cpp\qt_projects\hrlogger_development\debug\tqsl lib
LIBS += -L"C:\cpp\qt_projects\hrlogger_development\debug\tqsl lib"
LIBS += -ltqsllib2


The first time I try to access the library is like this:


int ret = tqsl_init();
qDebug() << "ret from tqsl is " << ret;


tqsl_init() is defined in the tqsllib.h file I have included and the .h is in the proper directory.

So, as Wysota would say, what is the error?
The code compiles with no errors.

But the error is that when I put the code in to call tqsl_init() as shown above, the application crashes as it starts. With that code commented out, the application runs normally.

So what am I doing wrong here?

ChrisW67
15th November 2010, 06:24
Is tqsllib2.dll (whatever it is) in the PATH of the environment in which you run the executable?

tbscope
15th November 2010, 06:54
Can you explain "the application crashes as it starts" more?
There are several ways why an application might crash when it starts.
Is there any error code shown?

Edit: when the code compiles and links without error, at least the compiler and linker were able to find the library and its prototypes.

boudie
15th November 2010, 12:15
Has it something to do with this:
http://www.trymytools.com/error_dll/tqsllib2.dll.html

If that's the case, your program seems not to be the problem...

waynew
15th November 2010, 13:06
Well Chris, it wasn't, but adding it didn't change anything.

By crash, tbscope, here is what I mean. I am using testlib and console for easy viewing of debug messages. When I start the application, the console appears for a fraction of a second then disappears and the main window never shows. The application output shows this message:
Starting C:\CPP\QT_Projects\HRLogger_Development\debug\HRLo gger.exe...
C:\CPP\QT_Projects\HRLogger_Development\debug\HRLo gger.exe exited with code -1073741701

boudie, I don't know where that website got that info, but here is the sourceforge project page for the library:http://sourceforge.net/projects/trustedqsl/ What they are saying makes no sense to me. The only people who would use this dll are amateur radio operators coding a program to digitally sign contact log records.

Thanks for your input folks - any other ideas? This really shouldn't be that difficult but it's driving me nuts.