This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using DLP Spectrum Library as DLL for a project in Visual Studio

General Setup:

A simple cpp application which uses HIDAPI library to communicate with NanoEVM . This HIDAPI is compiled as a DLL in Visual Studio using msvc compiler.

Try 1:

I've used MinGW/MSYS2 Environment to compile DLP Spectrum Library to a DLL File. This DLL was linked (Using it as an additional dependency in MSVS Project) to the executable. The test programs compilation succeeds. However, when executed, the function call dlpspec_scan_read_configuration() sometimes just simply does not execute, sometimes doesnot return back, sometimes works as expected and returns back with valid data.

For this try spectrum library was built using commands from build-dll.bat. Manually generated a .lib file for the corresponding .dll file using Visual Studio Developer Tools

Try 2:

This time used MinGW/MSYS again to compile libdlpspec as a static library (.a file). The compilation in Visual Studio fails because of unresolved external symbol __errno and __getreent originating from functions of the TPL Binary serialization library.

After some further research found that these symbols were part of Cygwin suite.

Try 3:

Freshly installed Cygwin with bintools, gcc and compiled the DLP Spectrum Library to a static library. This time also got similar unresolved external symbols as in Try 2 so I also linked libcygwin.a (from Cygwin installation) to the project and now the build succeeded. However, the behavior of dlpspec_scan_read_configuration() is the same as in Try 1.

Could anyone please throw some light at the missing detail. Is there any way to get this setup running properly using Visual Studio - Win32 Console Application working ?

My next try: (Which I am still quite hesitant ATM) To build the test application along with HDIAPI and libdlpspec completely in Cygwin

  • HI, can you please let me know the version of the DLP Spectrum Library and the Visual Studio you are using?

    I will try to reproduce the same use case here and investigate.

    Thanks and regards,

    keerti.

  • Thanks for the reply. I was able to solve the issue by patching and compiling dependencies - hidapi and DLPSpec for MSVC++ compiler rather than mixing up binaries from nix like environments (mingw or Cygwin) with visual studio.

    But this time created a static library of DLPSpec and linked it to the executable

    Nevertheless these are the specifics. I was using DLP Spectrum Library v 2.0.2 and Visual Studio 14 (CE 2015)