asimpleperson123 · 2022-05-31 16:20
I have some opengl code to open a window and draw a rectangle.
After I have compiled the code. I then run the executable:
https://preview.redd.it/c14maxer6u291.png?width=1824&format=png&auto=webp&s=d594d17d3fc5a2e9ea39cafd69fab780670c5c98
However, as you can see there is not messages in the compilation buffer which I told the program to print before it entered the loop to open the opengl window.
It is only when I close the opengl window that the compilation buffer is updated with the text which should have been printed before the window opened:
​
https://preview.redd.it/hbcbx5p07u291.png?width=1819&format=png&auto=webp&s=7fccc48be6a8f40c43a3fedd74d195072f945331
Whenever I ran the executable in neovim's built in terminal it would always print out the text first and then open the window. It seems like the compilation buffer is not being updated until after the compilation is finished. Is there way for me to update the compilation buffer whilst it is still doing the compilation?
hkjels · 2022-05-31 16:44
The default behavior is to update immediately, so you likely have something in your configuration blocking it
asimpleperson123 · 2022-05-31 16:48
[https://github.com/aliawan01/Emacs-Config/blob/main/init.el](https://github.com/aliawan01/Emacs-Config/blob/main/init.el) this is my init.el
hkjels · 2022-05-31 18:12
Can’t spot anything suspicious here. I’m reading it on my phone though. Have you tried without your configuration?
asimpleperson123 · 2022-05-31 18:52
Yes, I ran `emacs -Q` and tried to run my code. It does the same thing and only displays the messages after I have closed the opengl window.
KDallas_Multipass · 2022-05-31 20:23
Does run.bat run your executable after compiling it?
Also, standard output might be buffered and you don't have much output there. Try sending to standard error and see if that does what you want.
Don't do this for regular debugging, just realize that sometimes std out can be buffered in some cases
asimpleperson123 · 2022-06-01 09:48
You seem to be correct, when I sent all of the output to stderr it printed it out immediately. Is there a way for me to force emacs to read from the stdout stream?