sccn / liblsl

C++ lsl library for multi-modal time-synched data transmission over the local network
Other
107 stars 63 forks source link

Running SendData.cpp example causes assertion failure #175

Closed JYoung2123 closed 1 year ago

JYoung2123 commented 1 year ago

Running the SendData example causes the following output and error popup: e6f659bd-6765-4c56-9e2d-d544d3414ff1

cboulay commented 1 year ago

Did you build this yourself? Or is this worth a binary you downloaded from somewhere?

JYoung2123 commented 1 year ago

I setup a project in visual studio and pasted this code from the examples folder, so I assume Visual Studio built it?

On Sat, Nov 5, 2022, 5:50 PM Chadwick Boulay @.***> wrote:

Did you build this yourself? Or is this worth a binary you downloaded from somewhere?

— Reply to this email directly, view it on GitHub https://github.com/sccn/liblsl/issues/175#issuecomment-1304655986, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVPFQRKZABA2OAQWOPEI46DWG3QEFANCNFSM6AAAAAARYDKNOU . You are receiving this because you authored the thread.Message ID: @.***>

cboulay commented 1 year ago

I'll try to replicate it. Which visual studio did you use?

JYoung2123 commented 1 year ago

Visual Studio 2022, 17.3.6 For reference, I imported the headers/lib files from liblsl-1.16.0-Win_amd64.zip

cboulay commented 1 year ago

There isn't any problem with this repo, neither the library code, the release library archive, or the SendData.cpp source. Edit: SendData had a tiny bug.

I just did the following 3 tests, without issue:

  1. Cloned the liblsl repo, built the whole thing, including the examples, and ran SendData.cpp without issue
    • This is a bit different in that the linked lsl library is freshly-built.
    • Edit: Not sure why I didn't trigger the problem here.
  2. Downloaded the same liblsl release you linked above, cloned an application repo (labstreaminglayer/App-AudioCapture), configured its build to use the liblsl release, built and ran the AudioCapture app. (Also fixed an old error it had, unrelated). This also worked.
    • Unlike your project (at least from what I can infer), this used CMake and Qt.
  3. Used a fresh visual studio project.
    1. Create a new source file with its contents pasted exactly from a copy of SendData.cpp.
    2. Modified the project properties C\C++>General>Additional Include Directories to add the include directory in the extracted archive.
    3. Modified the project properties Linker>General>Additional Library Directories to add the lib directory in the extracted archive.
    4. Built the project.
    5. Manually copied lsl.dll into the same folder as the Project1.exe (i.e. Project1\x64\Release)
    6. Ran the executable without error.
    7. Edit: Also not sure why I didn't trigger the problem here. I'm starting to think I had a local branch with the fix?
cboulay commented 1 year ago

Oh, maybe I spoke too soon, I was just able to trigger it. I'll continue looking.

cboulay commented 1 year ago

OK, it's fixed now. 08aa186326e9a339316b7d5677ef31b3651b4aad