I wrote a simple openGL application using C++ and SDL2. I’ve compiled it using CMake on linux and everything works fine. How do I now run my program on other systems? Is it possible to compile the program on my linux machine and then open the compiled output file on another linux machine? Or does every machine have to compile
Tag: c++
How are parameters passed to Linux system call ? Via register or stack?
I trying to understand the internals of the Linux kernel by reading Robert Love’s Linux Kernel Development. On page 74 he says the easiest way to pass arguments to a syscall is via : Somehow, user-space must relay the parameters to the kernel during the trap.The easiest way to do this is via the same means that the syscall number
Linux: Why does the FIFO scheduler not work as expected on the 1 core CPU machine?
I am learning about Linux scheduler. Firstly, I want to test the FIFO scheduler. Here is the code I use to test: I run this program with the priority 1 on 2 terminals: ./main 1. Because my CPU has only 1 core, I expect only the first terminal can run because of the FIFO attribute. However, in the real-test situation:
How do I specify which of two kernel modules to compile with a Makefile?
I have a Makefile that compiles two Linux kernel modules (mod1.c and mod2.c). This works fine to build both kernel modules when I run make, but I would like to be able to specify which module to build. For example, make mod1 to compile mod1.c and make mod2 to compile mod2.c. The thing that I am unsure of is how
sending input from file descriptor
I have a binary that I’m debugging remotely, one way for me to send input to that file is throw when I do the above the input is been received by the binary but I can’t simulate a keypress, and that causes me to switch to that binary and press enter every time. here is an example when you run
Standard C library linker issues while compiling and linking using ARM Compiler 6
I am facing some linker issues in ARM DS IDE, i am trying build code for ARMVv-8 architecture, Cortex A72 processor with ARM Compiler 6. I think those error are related to standard libraries like stdio.h ,math.h these errors should not come as linker always looks for standard libraries paths on Linux machine. Am i missing something or making some
c++ Windows debug performance is very slow vs linux
I have a Cmake OpenCV project. If I execute the same project under Windows in the debug configuration is the performance very bad and I place zero breakpoints. In the release modus, I get the same performance as on Linux. Why is the performance better on Linux than on Windows? Can I fix the performance issue on window? I use
QT diconnect from wifi
I need to disconnect from current access point. I wrote this piece of code: How can I disconnect from wifi? Or should I use C/C++ (some API) for that? Answer You can use QProcess and run system commands to connect and disconnect WiFi like below but this is Linux solution: Replace wlp3s0 with your WiFi interface name. You can find
what’s the meaning of exit code of program with empty void main()?
I made a simple C program with empty main as given below and compiled it with gcc upon execution, it return exit code as 25, and if I add a printf statement,after including stdio.h, it returns exit code 5 what’s the meaning of 25 and 5 here and why it’s being returned by whatever code that is executed before or
output in Line A and Line B?
What would be the output in Line A and Line B? Do you think there is synchronization problem in updating the variable value? Answer Child value is 200 and Parent value is 300 always. pthread_join causes the main thread to wait until the other thread finishes executing. Both threads are acting on the same global variable. So the thread_prog thread