Questions tagged [c]

C is a general-purpose programming language

Filter by
Sorted by
Tagged with
3 votes
2 answers
5k views

How can I run an c/c++ program that use GNU Scientific Library (GSL)?

I'm trying to run 2 simple examples in c/c++ using the GNU Scientific Library. That are the codes: 1st: An Example Program #include <stdio.h> #include <gsl/gsl_sf_bessel.h> int main (...
2 votes
3 answers
7k views

libusb program not compiling

I am trying to compile a program that uses libusb library in Ubuntu 12.04. I have installed the libusb-1.0-0-dev. However, when I try to compile a program as below: #include<usb.h> #include<...
0 votes
1 answer
29 views

Custom alias to run and compile .c file

I'm trying to create custom alias to to compile and run my .c files in one command. I tried to add this line in /.bashrc_aliases alias runc='gcc $1 -lm && ./a.out' however I get an error and ...
0 votes
2 answers
138 views

Embedded studio

I used to program embedded microcontrollers with keil uvision software on windows but recently I switched to ubuntu operating system and still don't know how to program microcontrollers (cortex -m3 ...
0 votes
1 answer
63 views

Is the creation of linux shared libraries consistent between linux x86_64 and arm64 architectures?

I'm wondering if the way we create shared libraries is the same between these two architectures. Let's say I have the file fx.c that contains some function definitions, so I would create a shared ...
0 votes
1 answer
4k views

How to link ffmpeg libs to my C program

I am new to Linux/Ubuntu. I just installed ffmpeg via terminal (sudo apt-get install ffmpeg). I found a tutorial on in it with C programming. The tutorial doesn't show how to link the libs as ...
0 votes
1 answer
4k views

iPerf :WARNING: did not receive ack of last datagram after 10 tries

client side: iperf -c 10.0.1.5 -u Client connecting to 10.0.1.5, UDP port 5001 Sending 1470 byte datagrams, IPG target: 11215.21 us UDP buffer size: 9.00 KByte (default) [ 28] local 10.0.1.2 port ...
0 votes
1 answer
6k views

GCC Fatal error output: no such file

I been trying to compile a c file with gcc filename.c -o outputfilename but gcc gives gcc: error: No such file or directory<br> gcc: fatal error: no input files<br> compilation ...
4 votes
1 answer
3k views

make file error, trying to install intel power gadget

I hope another Ubuntu user has tried to run Intel power gadget and knows what problem I am having. I am trying to install the power gadget, running the make file i get an error message: /usr/lib/...
4 votes
3 answers
21k views

How to install Xaw package with header files?

I'm having this error on Ubuntu 14.04: checking for X... libraries , headers /usr/include/X11/ configure: error: Cannot find required Xaw header file Box.h; PDCurses cannot be configured How can I ...
1 vote
1 answer
370 views

bpftool: unable to understand lpm_trie keys

I am entering the following commands: $ sudo bpftool map create /sys/fs/bpf/routes type lpm_trie key 6\ value 1 entries 256 name routes flags 1 $ sudo bpftool map update id 194 key 8 0 0 0 0 10 ...
1 vote
2 answers
825 views

How to use KDevelop with github?

Previously I used VSCodium for my C and C++ programming needs. But I a beginning to like KDevelop more. There is actually 2 things that I'm unable to setup properly on KDevelop: Github integration and ...
-2 votes
1 answer
11k views

Directory path to open a file in c program

I am trying to append data to a text file (info.txt) at the home directory using C programming language. I am supposed to use the function fopen() that has the following syntax fopen("file path&...
0 votes
0 answers
39 views

TurboC Dosbox changing windows using Super+Tab or Alt+Tab

I use Ubuntu 22.04.2 LTS, I recently installed and configured Turbo C on dosbox, i attend online courses and use Turbo C to practice. Is there a way that i can use super+tab or alt+tab to change ...
0 votes
0 answers
45 views

Adding gtk3 accelerators in C

I'm trying to implement accelerators in gtk3 for my app. I found out how to do it from a post on github. #include <stdio.h> #include <gtk/gtk.h> // This is a callback that will be called ...
0 votes
0 answers
60 views

Utility to detect defect C/C++ compiled/object file

Is there a Linux utility to detect a defect C/C++ compiled/object file interrupted amidst its compilation progress ? How its simplest usage ?
1 vote
1 answer
4k views

How to compile Linux kernel module: printk missing?

So I'm trying to compile a simple kernel module on Ubuntu 18.04, kernel 4-15.32 generic: #define MODULE #include <linux/module.h> #include <linux/kernel.h> int init_module(void){ ...
1 vote
2 answers
3k views

Undefined references to powl and log10 even though -lm is used (Trusty via Travis)

When compiling C files with cc -lm -std=c99 ... in Trusty, I get the following error: fraction_math.c:(.text+0x5cb): undefined reference to `powl' /tmp//fetlang_build//fet_obj_debug//core/chain.c....
3 votes
1 answer
11k views

Lightweight C/C++ editor with code completion and debugging

Ever since the debugger plugin for geany stopped working (see below), I am looking for an editor for C/C++ source files with the following features: Code completion (i.e., Intellisense-like ...
0 votes
1 answer
2k views

Ubuntu 23.04 C Compiler cannot create executables - C compiler works no

This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by liberasurecode configure -, which was generated by GNU ...
0 votes
0 answers
94 views

PTRACE_PEEKTEXT ptrace: Input/ouput error

I try to read the values from memory with using PTRACE_PEEKDATA. To find the memory address of specific line I am using with objdump - objdump --dwarf=decodedline ./exe_filename and got the output: ...
5 votes
3 answers
18k views

How to install clang-14 on Ubuntu 18.04?

Can you help me install clang-14 on Ubuntu 18.04? I think I need a valid repo as apt-get install clang-14 does not work. $ cat /etc/issue Ubuntu 18.04 LTS \n \l $ sudo apt-get update Hit:1 http://...
1 vote
2 answers
21k views

system("pause") for linux in gcc C

What is the system("pause") equivalent in Linux on C language. not C++. I want to use that for my c program. Theres a logout function. But before it returns to the main login function i want to give ...
0 votes
0 answers
579 views

Problem in installing GCC (G++) 5 in ubuntu 22.04

I needed gcc 5 on my ubuntu 22.04. I tried using "sudo apt-get install gcc-5 g++-5" but this output is coming: sudo apt-get install gcc-5 g++5 Reading package lists... Done Building ...
1 vote
0 answers
265 views

PTRACE_TRACEME error "Operation not permmited"

I am trying to use PTRACE_TRACEME to trace the child process: if (ptrace(PTRACE_TRACEME, 0, NULL, NULL) == -1) { perror("ptrace_traceme"); exit(EXIT_FAILURE); } And I got the error: ...
0 votes
0 answers
229 views

gnuplot undefined symbol in c

I have a c program to plot a simple gaussian distribution. However, whenever I call the program I get this error: gnuplot: symbol lookup error: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so....
0 votes
1 answer
4k views

How to fix: "No Space left on device" on /tmp

I'm facing an issue where my program won't compile due to no device space in the /tmp folder. After a little examine and deleting all files on tmp it stills shows me the same error: after system ...
0 votes
0 answers
3k views

fatal error: sys/sysctl.h: No such file or directory compilation error, why this error?

/home/william/Desktop/BlitzMax/mod/brl.mod/platform.mod/glue.c:24:10: fatal error: sys/sysctl.h: No such file or directory 24 | #include <sys/sysctl.h> | ^~~~~~~~~~~~~~ ...
4 votes
3 answers
7k views

How do I install gcc 4.8 in Ubuntu 18.04?

I am currently using Ubuntu 18.04, and I need gcc 4.8 for MATLAB. So I tried to install gcc-4.8 using $ sudo apt-get install gcc-4.8 E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/...
2 votes
1 answer
185 views

How to add a custom context menu action to a certain mime type Ubuntu 21.10

I am making a installer for my program and I need to add a custom context menu action **only **to a certain mime type.
0 votes
1 answer
3k views

gcc compiler can't find include file stdio.h

The gcc compiler can't find the include file stdio.h. $ batcat test.c ───────┬────────────────────────────────────────────────────────── │ File: test.c ───────┼──────────────────────────────────...
4 votes
3 answers
15k views

Unable to install CBLAS on Ubuntu

I am trying to install CBLAS on Ubuntu, and am, as far as I can see, following the instructions in the README file that came in the folder. When I do a 'make all', I get the following errors that I ...
123 votes
8 answers
252k views

fatal error: sys/cdefs.h: No such file or directory|

It has been weeks that I am trying to use Code::Blocks IDE on Ubuntu 14.04 LTS to program Atmega16, however I am hindered by the following error while compiling/building the program in C::B /usr/...
0 votes
0 answers
228 views

Imagemagick C and C++ libraries can't be installed at same time on Ubuntu 22.04

apt install libmagickwand-dev graphicsmagick-libmagick-dev-compat Issue: apt won't install both packages at the same time. apt removes one when I install the other. If I attempt to install both at ...
0 votes
0 answers
124 views

When executing a compiled C/C++ file using seccomp and execve in the below code, it is exiting with status 159 and signal 31

I'm trying to execute C/C++ code in a secure environment using Seccomp and Ececve. But, C/C++ code is not being executed while trying with this setup. Please look at the files. seccomp_rules.c #...
1 vote
2 answers
623 views

ncurses installed... but won't compile code

I've recently returned to Xubuntu 22.04 after a brief stint on Fedora. Under Fedora, I seemed to be able to install ncurses okay. I could then simply write code and compile with commands like: $gcc -...
0 votes
1 answer
159 views

Symmetric private key generation using ESAPI API TPM

I was going through the ESAPI APIs , I have hosted the TPM simulator on my Ubuntu 22.04 desktop and trying to generate the symmetric private key from one C program and another C program using the same ...
0 votes
0 answers
58 views

Snap CLion IDE exits on run

I installed snap package of CLion IDE, when I launch it from ULauncher it exits upon clicking run, however when I run it from the terminal it seems to work just fine, what could be the cause of this? ...
5 votes
2 answers
22k views

fatal error: openssl/evp.h: No such file or directory

I run: gcc bruteforce.c -o bruteforce -lcrypto There is a header file #include <openssl/evp.h> The code perfectly works in another machine But it has the following error in my current PC. ...
13 votes
2 answers
42k views

Where are header files for GCC located?

I want to manually add some header files like math.h and graphic.h for gcc but don't know where to put them.
0 votes
1 answer
665 views

Why this orphaned process is called by a child process of init instead of init?

I know that all orphaned process are taken over by the init process(mother process) but I wrote a c program to understand how processes really work and I notice that a orphaned process is taken over ...
3 votes
1 answer
2k views

How to control mouse cursor using c?

As in windows there is a function setCursorPos in windows.h for controlling cursor position. What is the way to do this in ubuntu?
1 vote
1 answer
255 views

Output not showing in my ubuntu while compiling c

While compiling my C code in sublime-text in my Ubuntu The output is not shown.enter image description here
0 votes
0 answers
49 views

Error in STM Code after compliling on Ubuntu

I'm following this tutorial for setting up the STm32MP157C-DK2 microcontroller. On the steps for creating a basic hello world program, I am able to compile a program and upload it to the STM through ...
15 votes
2 answers
4k views

Can I act on the event that a window opens without polling?

I am trying to find a way to detect the event of a window (any window) being opened in Ubuntu 16.04 I would like to be able to detect the "window open" event and check if the opened window was my ...
2 votes
2 answers
860 views

Read GPIO-ports from C-program

Iḿ trying the following: - we have a AXIS-controler which is connected to the Linux (18.04) via an CP2102-chip to an USB-port. We want to read the values of the GPIO 0-3-bits via a C-program on the ...
5 votes
3 answers
3k views

How to print the ■ character in linux terminal using C?

This char is 254 in ASCII Extended Table, and 25A0 in Unicode. If I run putchar(254) the terminal does not recognize the char, as I think it utilizes not extended ASCII.
0 votes
1 answer
274 views

sudo command make child process to zombies

I'm trying to make a program that divides into child and parent processes with fork(). Child executes arguments with execv() and parent traces him with ptrace(). I made almost all parts of the program,...
0 votes
1 answer
601 views

libc.6 is a symlink to libc-2-31?

I'm running ubuntu 20.04, and I'm tryying to run a python pwn script that has the following line: libc = ELF("./libc.so.6") Which fails with: No such file or directory: './libc.so.6' So I ...
1 vote
1 answer
736 views

Download Linux native x86_64 GCC toolchain?

I'd like do download the GNU GCC package toolchain for Ubuntu, and not install it (sudo apt install build-essential) - just download. There are toolchains for cross-building for Arm targets, but I ...

1
2 3 4 5
10