I have created a C++ standalone exe with VS2019. This exe uses 1 external ressource file. This exe creates WAV files. It does not use any special libraries. I have been asked if this application runs under Linux, too. What would I have to do / check to see if / how I can compile my application for Linux, and
Tag: c++
Generate combined virtual key presses to get chars like â, ó, ć, and more complex
I’m implementing a virtual keyboard using QML. So far I literally map the char to print for the different key maps (w/o shift, with shift, with Alt Gr, etc.). So I have to write down all the chars for different layouts somewhere in the code. Especially for layouts and languages where two or more key presses generate a more complex
C Linux Check free space in mount
When I running df -h I can see that in /dev I use 6M and the size is 40M , and Available size is 34M . How can I get this information with c code? Answer From here: Use the statvfs API: and the prototype of the statvfs is The results will be filled to the buf statvfs struct: The
“Python Exception There is no member named _M_dataplus.” when trying to print string
I’m trying to debug a segfault in a homework program and I’ve discovered that my GDB can no longer even print std::strings. How can I fix it? I’m on Ubuntu 18.04 LTS. CLang++ version: GDB version: I’ve writen a small test program called gdbbroke.cpp: I expected print test to output: However it just throws the Python error above. Answer With
How do run executable c++ through terminal in debug mode?
I have a c++ executable file named test .. To execute it in my terminal I run….. Although I want to run it in debug mode wherein it shows the exact command being used immediately after being executed If you are wondering what exactly I mean by debug mode.. Just like how we use -x for shell scripts This shows
Memory layout of C program
When I run this C code, I get the following output as shown. What these numbers mean, why they are like that and what can we learn from it about the position of the variables. Output: Answer In general, memory is laid out as such: When you initialize a local variable like a, b, age, each variable is allowed to
Multithreaded word count in C
I know I said I would try to figure it out on my own and I really did, and then I looked elsewhere first before posting here again but then I just ended up with this mess: How best should I fix this? Specifically these errors and warnings: I think the part for counting words from the buffer is okay,
gcc-7: error: unrecognized command line option ‘-m64’
I’m trying to compile C code on a Jetson Nano and I get this error during compiling. I tried removing any occurrence of ‘m -64’ but it seems like its added automatically. This is the cmd where it fails: /usr/bin/gcc-7 -Wall -Wextra -Wconversion -pedantic -Wshadow -m64 -Wfatal-errors -O0 -g -o CMakeFiles/dir/testCCompiler.c.o -c /home/user/dir/CMakeFiles/CMakeTmp/testCCompiler.c gcc-7: error: unrecognized command line option ‘-m64’
Why is the following shell command working when executed directly in command line, but not working when executed through C program using popen/system?
The command is : ps -c -p | tr -s ” ” | cut -d ” ” -f 2,6-10,13 | grep ‘R’ I am running it through adb shell. Basically, I want a list of processes (and certain parameters) which are currently in the run queue. This is working fine if I run it directly through the shell. However, if
Debugging Linux process hangs, which code is it running?
I have a process running on a very weak Linux embedded device, which could not run gdb / gdb server on itself. I let it provoking a function X from a shared library repeatedly (there are also some others process calling it at the same time with much less frequency), it usually hangs somewhere inside the shared library after 1