0

I've installed these packages on my system:

  • Qt 5.3.1 for Windows 32-bit (VS 2013, OpenGL, 557 MB)
  • Visual Studio Add-in 1.2.3 for Qt5

I want to use my Win32 DLL that contains background logic for my Qt application. What I've done is included the headers in C++ -> General -> Additional Include Directories and referenced the DLL file in Common Properties -> References. This method worked fine with a Win32 console application I used for testing prior to creating the Qt project under the same solution. I've also tried the Copy Local option (VS reverts it back to "False" every time, for some reason) and putting the path of the directory that contains the .lib file in Linker -> General -> Additional Library Directories, that file was then included in Linker-> Input -> Additional Dependencies. Nothing seems to work. The code should supposedly be ABI-compliant since everything was compiled using MSVC. I've also read this question - maybe it has something to do with that?

All of the public methods in the DLL project were exposed with a __declspec(dllexport) prefix. I haven't used the extern "C" part nor BOOL APIENTRY DllMain like in this question.

The error that pops up when I try to run the project: Error

EDIT: I've now tried changing the Qt app's build output folder to that of the DLL project. It does run now (only through VS), but upon exiting it throws an access violation exception concerning the Qt5Widgetsd.dll library:

Problem signature:
  Problem Event Name:   BEX
  Application Name: RagingSeasGUI.exe
  Application Version:  0.0.0.0
  Application Timestamp:    53fccbaa
  Fault Module Name:    Qt5Widgetsd.dll
  Fault Module Version: 5.3.1.0
  Fault Module Timestamp:   53a2bfdb
  Exception Offset: 0052f2b4
  Exception Code:   c0000005
  Exception Data:   00000008
  OS Version:   6.1.7601.2.1.0.256.1
  Locale ID:    1050
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Community
  • 1
  • 1
Venom
  • 1,107
  • 4
  • 21
  • 46
  • This error appears when you run from visual studio, or when you double-click the .exe? is the dll in the same directory as your .exe? – Mr.WorshipMe Aug 26 '14 at 17:44
  • @Mr.WorshipMe Every project is under the same solution - DLL, console and Qt. It happens when I try to run it from VS. Copy Local doesn't work, VS overrides it for some reason. I tried copying it directly using the file system but it crashes upon exiting. That's not what I want anyway. – Venom Aug 26 '14 at 17:53
  • @Mr.WorshipMe Access violation is my fault, I was deleting uninitialized pointers. Simply set them to nullptr in the default ctor. Still, I face the problem of linking all of this stuff together - Boost, Qt, my own DLL... But that's another matter, completely. – Venom Aug 26 '14 at 18:34

1 Answers1

0

Solved by changing the Qt project's build output folder to the same one as the DLL project's: Configuration Properties -> General -> Output Directory. Still don't understand why Visual Studio won't let me use the "Copy Local" option.

Venom
  • 1,107
  • 4
  • 21
  • 46