Ok, I’m looking for a solution for 2 days now. I didn’t find anything to solve my problems. What is currently going on? So, I tried creating a dynamic library (.so) on Linux Mint Maya 13 with g++. foolib.h: foolib.cpp: main.cpp: I compiled these files with these instructions: libfoo.so: foo: Creating libfoo.so works without any errors, but foo throws undefined
Tag: c++
What is the performance penalty of C++11 thread_local variables in GCC 4.8?
From the GCC 4.8 draft changelog: G++ now implements the C++11 thread_local keyword; this differs from the GNU __thread keyword primarily in that it allows dynamic initialization and destruction semantics. Unfortunately, this support requires a run-time penalty for references to non-function-local thread_local variables even if they don’t need dynamic initialization, so users may want to continue to use __thread for
QPainter Save State
I have a QWidget in which I use a QPainter object to draw some dots but when update() method is invoked, the QWidget’s draw is cleared completely. Is there any way to save the actual state and just add dots, or i have to save every dot and paint them in every paintEvent() call ? Basically when I press an
Eclipse CDT: Symbol ‘cout’, ‘map’, ‘vector’, ‘size_t’, etc could not be resolved
There is a lot of posts about that and I have already tried to apply solutions that have worked for others, but still not for me. First, everything was fine with a c++ project I am working on under Linux, with Eclipse Indigo, gcc-4.7.1, cx11 activated, and Gentoo Linux. My project uses a home built static library. I made some
Under Linux, can recv ever return 0 on UDP?
I’m just cleaning up some code we wrote a while back and noticed that for a udp socket, 0 is being treated as the connection closed. I’m quite sure this was the result of porting the same recv loop from the equivalent tcp version. But it makes me wonder. Can recv return 0 for udp? on tcp it signals the
how to intercept calls to the file systems
I am interested in intercepting all system calls related to the file system and instead having my own code run. For example, calls to creat, write, close, lseek, getcwd, etc. My goal is to create a function like execve that captures all file I/O from the spawned program to an in memory filesystem managed by the calling process. This way
error in clone system call sentence in c++
I am trying to to run c code in c++ which uses clone inside , I got an error which I couldn’t solve it , anyone used clone in c++ before , and can help . my code: and i got the errors: dell@ubuntu:~$ g++ n.cpp -o n n.cpp: In function ‘int main()’: n.cpp:40:62: error: invalid conversion from ‘int ()()’
Detect death of parent process
How can I detect parent process death in Linux OS? If in parent process called fork(), that create child process. In the parent process I can use system call wait() for waiting terminated child process, and getting its status. But, I can’t find info about how child process can detect parent process’ death? Answer You can get the parent process
How to get a pointer to a specific executable file’s section of a program from within itself? (Maybe with libelf)
I’m on a Linux environment and I need to make a program that retrieves some data that is placed in one of the sections of its executable file. So, how to get a pointer to a section of a program (by its name) from within itself? I know it’s possible to use elf_getdata() passing the index of the section as
How to use Callback function to get language in Tizen?
I want to write a native application in c to get the value of language in Tizen. The compiled c code must be run on the Tizen phone and I need to get the Value of language. The callback function i got from Tizen source is How to use this function to get the value of current language? Answer Since