#Endless main function somehow ends in my PortAudio using code and I can`t understand why
25 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
what does the terminal show if you run this:
linux/bash:
echo $?
windows/powershell:
echo $LASTEXITCODE
(right after the program ends)
(in the same terminal that it was running from)
if it returns non-zero and the value isn't one of the -1's you return in main, the code itself might give you a hint. if it crashed, those values will tend to correspond to error codes you can search for (sometimes, not always)
I can`t if I press any button console closes
how are you running it?
In VisualStudio 2022
oh, if you're already launching it from a debugger you probably just need to make sure all exceptions are enabled to pause the debugger when any are thrown
that will pause the code in place if/where it's crashing
if you type in "exceptions" in the search box at the top of VS2022, you should see an option to open the exception settings
or you can get to it from "Debug" -> "Windows" -> "Exception Settings". just make sure the win32 and c++ exceptions are both checked off. the other ones probably won't get thrown if your application is purely C/C++
the window should look like this, and you can just check off the ones you want the debugger to capture:
if you haven't been using the debugger to trace through the code as it's running, you should also toss a bunch of breakpoints in areas that you think might be causing the problem, then just stepping through things 1 line at a time until you're able to spot what the cause is (if it doesn't end up being a crash)
C:\Users\Ринат\source\repos\neuronka\x64\Debug\neuronka.exe (процесс 17700) завершил работу с кодом -1073740791.
Нажмите любую клавишу, чтобы закрыть это окно:
It how it ends, without any errors
I can`t it always says about it have no acces to some dll files
oh, you need to make sure any DLLs that are needed are either in your PATH or just in the same folder as the executable
it has to load those libraries on init of the program to work if your code depends on any additional shared libraries / DLLs
what if do not know what is dll filesand where i must search for it? Just it says it about fstream proceses and about portaudio ones
there is how it looks when i start debug run
oh, also it works only one standart 256 samples buffer and ends after this
maybe problem somewhere in my callback function?