Skip to content
Advertisement

Tag: c++

Build .so file from .c file using gcc command line

I’m trying to create a hello world project for Linux dynamic libraries (.so files). So I have a file hello.c: How do I create a .so file that exports hello(), using gcc from the command line? Answer To generate a shared library you need first to compile your C code with the -fPIC (position independent code) flag. This will generate

How to design GUIs on Linux and C++ [closed]

It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago. I am new to Linux. I would like to be able to program

Generate LLVM C++ API code as backend

The Online LLVM demo page had an option to generate LLVM C++ API code as backend from a source code. However, that demo page is now disabled. I was wondering how we can do it ourselves using the available LLVM tools. I tried the following which gives the following error I am using LLVM/Clang version 3.2. Answer The LLVM C++

Buildroot : Which gcc for cross compilation?

I am newbee to buildroot. I can see multiple gccs in buildroot. I assume all are for cross compilation. What are the difference between those ? Answer The one you should use is buildroot-2012.05/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc. The other ones are purely internals binaries.

ALSA: Ways to prevent underrun for speaker

I am playing a single channel audio in non-interleaved mode. I am getting underrun when I am writing audio data into speaker : ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred Here is how I write: What are the different ways/parameter configurations to prevent ALSA under run ? (I am using Linux 3.0, ARM ) Edit: Here is a buffer measurement using snd_pcm_avail()

Delete a Linux signal handler in C

I use: To add handler of SIGINT event. But how can i delete this handler? Answer Here is what you do: That resets the signal handler back to whatever the default behavior was for that signal (including the default disposition if it hasn’t been set). In the case of SIGINT, it’s aborting your process without a core dump. The manual

how to verify tcp checksum [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 10 years ago. For some odd reason,

Troubles with using memcpy with mmap

Trying to copy a file using these functions, everything goes fine until program hits the memcpy function which gives a bus error and terminates the process. Failed to figure out what is wrong, as “Bus Error” isn’t a descriptive error message and there isn’t any much material on the internet regarding this problem. Answer When you create the destination file

Advertisement