I am new to writing c under linux so this will be maybe silly question, but I have problem using fopen. When I encountered the problem I just tried it with this really simple code: test.txt is in same folder as this code and a.out. When I debug a.out I get: I tried changing the path: if( fopen(“/home/h1…
Tag: c++
Build Qt application for Linux in Windows using Qt Creator
I want to run a Qt application in Linux which is compiled on Windows using Qt Creator. I tried googling but I did not get any answers regarding Qt creator. I found for Visual studio. Can anyone please let me know if this can be done in Qt Creator in Windows7 ? Do I need to install any other compilers
F_SETPIPE_SZ undeclared
I have included following headers: I have also tried to use before #include <unistd.h>, but it also does not help. I try to use fcntl and pass it F_SETPIPE_SZ as second argument, but I keep getting this error message: error: ‘F_SETPIPE_SZ’ undeclared (first use in this function) I actually found out tha…
How to use atomic variables in C?
I need to use an atomic variable in C as this variable is accessed across different threads. Don’t want a race condition. My code is running on CentOS. What are my options? Answer If you are using GCC on your CentOS platform, then you can use the __atomic built-in functions. Of particular interest might…
System commands in c#
Does C# have an equivalent to the system command in C? for example, how would I do this in c#?. I’m using Mono on Linux. Answer No problem I got it. Tested and working on Ubuntu 13.10
Variable reset after scanf
I wrote the below function : I print the currentPlayer on any level to see what’s going on -> here what I get: Why the current player is 0 after scanf? I didn’t touch it. Answer The buffer location has only room for 2 characters and scanf puts an extra NUL character at end. Therefore you have a…
Basler Pylon 4 SDK and OPENCV 2.4.8, Linux simple viewer
I am developing a simple camera viewer to test Basler camera acA1300-30gc. I am working in Ubuntu 14.04 with Basler Pylon 4 and OPENCV version 2.4.8 because I am going to develop a machine vision application and I need to analyze frames on the fly. Based on OpenCV Display Image Tutorial, Sample Code in Pylon …
Why aren’t glibc’s function addresses randomized when ASLR is enabled?
In trying to understand ASLR, I built this simple program: ALSR seems to be enabled: and I used GCC to compile the program: Every time I run this program, it prints the same address (0x400450). I would expect this program to print a different address each time if glibc is loaded at a random address. This is s…
kvm: module verification failed: signature and/or required key missing – tainting kernel
I’m using Ubuntu 14.04 LTS and kernel version 3.13.11.4. I’m trying to load patched KVM modules kvm and kvm-intel and I’m getting the following errors kvm: module verification failed: signature and/or required key missing – tainting kernel and kvm: module has bad taint, not creating tr…
Can’t run c/c++ codes in code::blocks 13.12 on linuxmint 17: Status 255
I am not able to run any C/C++ programs in code::blocks. Could anyone please suggest why this is happening? Currently I have the gnu c and g++ compilers installed on the system. The error message on building and running this simple c code: is: Checking for existence: /home/user1/Desktop/progs/a Executing: xte…