Skip to content
Advertisement

Tag: c++

g++ custom dynamic library linking error undefined symbol

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

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

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

Advertisement