"DLL Initialization failed" library using Rhino SDK C++

I have an executable library (.EXE) to which a DLL library is linked. The DLL library is linked to the Rhino C++ SDK. I’ve narrowed it down, and linking the executable to this library when the dependency to the Rhino SDK is removed works perfectly.
Both are built under /MD /RTC1 and that uses MFC in a shared DLL and the Unicode Character Set.

The exe is basically a console subsystem for the unit tests and is also linked to GTest. The DLL is compiled with the following flags as well: -D_UNICODE -U_MBCS with the following preprocessor macros: _AFXDLL, WIN64, _WINDOWS, NDEBUG, _USRDLL . When I use an object from the DLL (an object to be tested from that library), and run the executable, the program crashes with the following error:

The program has exited with code -1073741502 (0xc0000142) 'DLL Initialization Failed'.

I’m running out of ideas as to why this is happening, is there anything specific about including a DLL library using the Rhino SDK in to a console executable? Thanks

Hi @blondbeer,

The Rhino C++ SDK can only used to build C++ plug-ins for Rhino. You can not use it to build a standalone .exe, as the SDK libraries are dependent on Rhino.exe.

That said, what are you looking to do in a console application?

– Dale

Thank you for your reply @dale
I have a DLL library that uses the SDK and contains low-level logic code of the application and its architecture. I want to unit test objects from that library, so basically I’m linking it the exe console app to access those objects.
What’s the best practice to do that?

We don’t currently have a good way to do something like this from C++. We had had success with using .NET testing frameworks to test .NET plugin code, but not c++.