Skip to content
Advertisement

Tag: c++

Transform a Commande Line Linux to a makefile [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago. Improve this question Is there anyone who can help me to transform this command line to a makefile : gcc -o hello_ps hello_ps.c -DMODELDIR=”pkg-config –variable=modeldir pocketsphinx” pkg-config –cflags

pointer get wrong value in different thread

I am writing a piece of code to demonstrate the multi-threading share memory writing. However, my code gets a strange 0xffffffff pointer I can’t make out why. I haven’t been writing cpp code for a while. please let me know if I get something wrong. I compile with the command: g++ –std=c++11 shared_mem_multi_write.cpp -lpthread -g I get error echoes like:

How to fix linker warning: “function undefined” in kernel space?

I’m working on an integrated SDK for powerpc microprocessor which has some kernel modules. The kernel(3.12.37) and toolchain(powerpc gcc 4.9.2) provided by Yocto project. When i make SDK in native machine(x86_64bit Ubuntu 14) by mentioned toolchain and kernel source, I see these warnings during compilation of kernel module: These warnings appear when i insmod kernel module. I realized that this

How does evdev determine whether or not to move the x11 cursor?

I’m starting to dig into the evdev api on linux for the purpose of playing around with uinput emulation. I noticed that between a joystick and a touch pad, there are different button/key event codes to distinguish between joypad button presses and mouse clicks. But both devices have event codes for ABS_X and ABS_Y axis. So how does x11 know

Check if at least one Wayland session is running

I’m using Qt and want to check if any Wayland session is running. For now I have this just for test code, that works as expected: Is it possible to get rid of QProcess and use Linux C++ API? Answer You can try to connect to Wayland. If you can connect to a Wayland composer it is running otherwise is

C system v Semaphore not locking critical region

I have a code that reads an integer from shared memory and then incerements the number in child processes. I’m using semaphore to lock this critical region so that the integer gets only increased if no other process is not increasing it. So I get a stable integer value. I have used SYSTEM V Semaphore for that, however I’m not

Mixing debug and release libraries: Windows vs Linux, static vs shared

This question has been asked a few times already, but I observe that it always refers to Windows. Which makes sense, given that MSVC fails with the following error: error LNK2038: mismatch detected for ‘_ITERATOR_DEBUG_LEVEL’: value ‘0’ doesn’t match value ‘2’ in main.obj And it seems to me that on Linux, it does not fail at build time. Answers mention

Change application core dump directory with c program

I have one scenario where I want to change directory for core dumps by current application using c program. I have one option to do chdir() to specified directory. But this changes the home directory of application. And I am looking for some APIs which can change directory for core dumps only. Answer You can change core dump pattern globally

Advertisement