Skip to content
Advertisement

Tag: c++

Writing a wave generator with SDL

I’ve coded a simple sequencer in C with SDL 1.2 and SDL_mixer(to play .wav file). It works well and I want to add some audio synthesis to this program. I’ve look up the and I found this sinewave code using SDL2(https://github.com/lundstroem/synth-samples-sdl2/blob/master/src/synth_samples_sdl2_2.c) Here’s how the sinewave is coded in the program: I don’t understand how I could change the sinewave formula

POSIX open() hangs on SMB share

I have a problem where I mount a Windows SMB share under linux with mount.cifs and write to files from my C++ program. This works fine, but as soon as network problems arise (i.e. Windows server disconnect), opening the file with POSIX open() will hang indefinitely. The same happens for the POSIX close() call if the share disconnects while the

How do I expose custom files similar to /procfs on Linux?

I have a writer process which outputs its status at regular intervals as a readable chunck of wchar_t. I would need to ensure the following properties: When there’s and update, the readers shouldn’t read partial/corrupted data The file should be volatile in memory so that when the writer quits, the file is gone The file content size is variable Multiple

Linker –whole-archive option

I am using C language. I am linking static libraries with –whole-archive. Linker is arm-none-eabi-ld For example, giving the following option to the linker: But still I get linking error: Why is the linking error happening? EDIT: Full command with output: Out put of: readelf -Ws kunit.a hal.a fs.a | egrep ‘ (mmu_init|exec_array|mmu_pagetable|_enter_kernel)’ is: Answer Why is the linking error

C/C++: POSIX compatible way to find default network interface up/down

I’m working on POSIX platform (PSE51 to be exact). I want to get notified when the default network interface goes up/down (via a callback or through continuous poll). The challenge is that I could find a linux specific way to get the default interface here and found a linux specific way to find the network is up or down here

*** No targets. Stop on Linux using C [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 2 years ago. Improve this question This is a very basic program because I am using Make and Linux

insmod fails with “Unknown symbol in module”

I am working on Linuxmint Cinnamon 19 Ubuntu 18.04, kernel version 4.15.0-20-generic The following I see during compilation: Then I try to install the module with sudo insmod elevator.ko Seeing in the logs: dmesg | tail Makefile elevator.c issue_request.c start_elevator.c stop_elevator.c Functions are static and there is only one makefile in same directory. So my question is: Why can’t the

Advertisement