0

I'm trying to run an out of the box ActiveMQ example http://activemq.apache.org/cms/example.html on Windows with VS 2008 in a 32-bit C++ Console application.

The project is built but when I run the program, I get the exception.

Unhandled exception at 0x768b3e28 in XXXXXX.exe: Microsoft C++ exception: std::length_error at memory location 0x0100f880..

I get exactly the same exception with same memory addresses when trying to run a separate project and with another 3rd party DLL (log4CXX).

Path Settings

The DLL file is in Windows/System32 as well as in Windows/SysWOW64.

I've the header file path added to Configuration Properties > C/C++ > Additional Include Directories. In linker > Input > Additional Dependencies, I've ws2_32.lib libapr-1.lib activemq-cpp.lib. In linker > General > Additional Library Directories, I've specified the path to folders where lib files are present. The path to the lib and header files are included and I believe that's why there's no issue in building the project.

Bokhari
  • 103
  • 1
  • 2
  • 9
  • 1
    You **do** need both the .lib file and the .dll file, in a place where the program can find it. On Linux a .so is a combination of these, but on Windows they are separate files. – Bo Persson Apr 10 '16 at 10:24
  • so is DLL a must have for running the program? Will VC not build it along with my project I'm referring. – Bokhari Apr 10 '16 at 13:27
  • Thank you @BoPersson, it was a really a silly question. I found the dll and the application should now work. – Bokhari Apr 11 '16 at 08:09

1 Answers1

0

The error was simply because the dll wasn't being found by the program. I simply had to put the dll on the system library folder (C:/Windows/SysWoW64) for a 32-bit dll on a 64-bit machine.

Bokhari
  • 103
  • 1
  • 2
  • 9