Questions tagged [c]

C is a general-purpose programming language

Filter by
Sorted by
Tagged with
0 votes
1 answer
159 views

How to loop a program?

I'm using a program named 'SExtractor' which takes astronomical images in imput and subtracts the skyglow giving as output the same image corrected. More specifically the output it's composed by four ...
-2 votes
1 answer
3k views

PROBLEM WITH COMPILER C/ PLEASE HELP ME [closed]

My first language is Spanish, and my use of English is not the best, but I need some assistance in debugging the following program code since it produces an error when compiled. CODE: #include "...
1 vote
3 answers
11k views

Compiling C code for ARM processor on Ubuntu 12.04

I am compiling my simple "Hello world" C code using the following command: arm-linux-gnueabi-gcc-4.4 test.cpp -o test It generates an error: arm-linux-gnueabi-gcc-4.4: error trying to exec '...
1 vote
1 answer
400 views

C++ code cannot create output file on Ubuntu 16.04 [closed]

Using Ubuntu 16.04 with kernel 4.16.7. I'm trying to benchmark an SSD using the code I found here: https://cristianadam.eu/20160410/c-plus-plus-i-slash-o-benchmark/ This test uses three different ...
1 vote
4 answers
8k views

How do I enable a buffer overflow?

I just installed 12.04 (WUBI actually) and I wanted to learn a bit about buffer overflow. Unfortunately when I try to use a function like puts() and gets() in an incorrect manner (that is, to cause a ...
0 votes
0 answers
107 views

Perf does not annotate .c files called by Rust

I am using perf to profile a rust application which calls some .c files. I want to annotate the .c functions. However in the perf report i can find only rust code annotated. I have compiled the ...
0 votes
1 answer
1k views

Set debugger from at&t to intel [closed]

I want to set my assembly debugger from at&t to intel in gcc. I'm currently on ubuntu 18.0. How can i do this?
1 vote
0 answers
474 views

Why does sudo prevent catching SIGTSTP (Ctrl+Z)?

This program is written to catch SIGTSTP (Ctrl+Z) and bypass its normal effect, printing a message and returning to its normal operation instead of allowing its process to be suspended: #include<...
16 votes
5 answers
41k views

Where's my /usr/include/sys directory?

I recently upgraded from Kubuntu 12.04 to 13.04, a complete reinstall. Using gcc 4.7.3. I compiled some programs to discover there is no /usr/include/sys directory. That is, types.h, stat.h, etc, ...
8 votes
2 answers
21k views

Can't access cairo.h

I've installed cairo-1.4.14 using make install, but after trying to compile my code: fatal error: cairo.h: No such file or directory #include <cairo.h> ^ I compile using ...
0 votes
1 answer
5k views

Undefined reference to symbol acos@@GLIBC_2.2.5 while compiling xpdf

I get the following error while compiling xpdf using make. I've tried using the command: LIBS=-l make but it doesn't work. I know the problem is that the c compiler cannot recognise the math code in ...
0 votes
1 answer
13k views

File doesn't open using fopen() function in C [closed]

I'm using Ubuntu 18.04 on VMWare Fusion. I have no idea why the file doesn't open using fopen() function in C. The code is below. #include <stdio.h> #include <stdlib.h> #include <errno....
1 vote
1 answer
4k views

Perf linux tool : Function name not shown in the symbol column [closed]

I am not sure if this is the right forum. I am trying to benchmark a simple compiled c code but i cannot see it's main and child functions in the perf report. All i see are system functions and hex ...
2 votes
1 answer
2k views

PHP exec() has write permission error despite write privilege

I am running 7.0.28-0ubuntu0.16.04.1, under LAMP, on two Ubuntu 16.04. The C code, to open the file for writing is: #define ERROR_OPENING_FILE -4 fprintf(stderr, "Open output file: /var/www/...
2 votes
1 answer
2k views

How to compile C program file in Ubuntu 18.04

I can't compile a C file in Ubuntu 18.04. In terminal I used this command: $ gcc -o abc.o abc.c -lm, but it says that gcc is not found. This exact command can compile a C program in Ubuntu 16.04 (...
0 votes
0 answers
321 views

gcc doesn't compile C How To Program 'create a random access file' tutorial

The tutorial on File Processing in C How To Program 6th Edition (Chapter 11 Fig. 11.11) creates a random access file sequentially. fwrite and fread are used in the code to create 100 blank records ...
1 vote
0 answers
748 views

Undefined symbol error

I'm working on a base project by someone else and I'm kind of new to the Linux system. I know how to use sqlite3 in Windows' Visual Studio, however in Linux it's not working. I've come to the ...
4 votes
2 answers
8k views

Are there drivers for OpenGL 4.3 for [AMD/ATI] Seymour [Radeon HD 6400M/7400M Series] (Ubuntu 14.04)

I want to be able to do opengl4.3 c/c++ programming, the [AMD/ATI] Seymour [Radeon HD 6400M/7400M Series] should be able to support it, I just don't know what drivers I have to install Also I have ...
2 votes
1 answer
376 views

Can't compile Ardour: "Can't find -lfftw3f_threads"

I am trying to install Ardour from source. I successfully completed the configuration process after a few failed attempts and installing the required libraries. Now the installation process cancels ...
4 votes
1 answer
8k views

How do I print backslash followed by newline with printf?

Using Python, I get $ python3 -c 'print("\\\n")' \ $ That is, one backslash and one newline, followed by an extra newline inserted by the interpreter. Using C, compiling the code #include <...
1 vote
0 answers
192 views

Question regarding rtl_fm and specific USB port connections

I am planning to use 2 RTL-SDR dongles on a single computer. The thing is, they will be operating on 2 different frequencies, and so different antennas will be used. I would like one instance of ...
7 votes
2 answers
12k views

Can't run my hello world in C

I'm trying to write a basic program in C using gedit or sublime text (which I prefer), but no matter what I do when I try to compile or run, or even while writing, I have no option to use 'stdio.h' or ...
-5 votes
1 answer
5k views

How do I run clang after installing it? [closed]

I have downloaded clang. When I got onto terminal and type clang it results in the error no input files.
-1 votes
2 answers
3k views

Compiling C programs on Ubuntu 12.04 [duplicate]

I'm an absolute beginner at writing programs in C, and I'm having difficulty compiling a simple program. Here's my code: /* This code is a .c file that prints out the words hello, world. */ # ...
3 votes
2 answers
1k views

C Library Function Actual Implementation

I was wondering where I can find the actual C implementation of atoi() (or other such functions). I looked into stdlib.h but it seems like atoi is not implemented there. Is there a way to view the ...
3 votes
1 answer
6k views

Crontab and C program that should be executed into a terminal window

I want to create Cron job to run a compiled .c file. Let's say I have a file, called program.c, on my desktop. I compile it using gcc program.c, which creates a.out executable file. I want to open a ...
1 vote
2 answers
1k views

What will happen if i type ctrl - c on the terminal [closed]

I got this program my friend sent me. And were both new at ubuntu and she asked me what will happen if we enter ctrl-c on the terminal #include <signal.h> #include <stdio.h> void catch(...
0 votes
1 answer
362 views

Setting up Lubuntu to access /usr/src/linux-headers-3.1.x.xx?

I need to access a block of memory assigned by a FPGA to a PLX chip. Now I don't think that will be too much of a problem except when I try and use the /include/linux-headers they seem to be somewhat ...
1 vote
0 answers
1k views

sprof fails to generate flat profiling for my shared library: Inconsistency detected by ld.so

I am unable to generate flat profiling result using sprof in Ubuntu 16.04.02 (as well as 14.04.01). Here is a reproducible example, adapted from man sprof. First create a directory for experiment, ...
2 votes
0 answers
5k views

Difference between amd64 and i386 version of Ubuntu [duplicate]

Can anyone explain the difference between these versions of Ubuntu? I installed 11.10 i386 and wrote some C code that worked fine in that platform but failed to work in 11.10 amd64 on the same ...
0 votes
1 answer
1k views

Gnome Builder Run Error

Hello community I'm the newbiest Ubuntu user ever. I'm also Computer Science student migrating to this operation system and looking for clean IDE to build my algorithms. I found one called "Builder" ...
1 vote
1 answer
1k views

How to install PAPI on Ubuntu 16.04 and access performace monitoring counters?

I need to count L2 cache misses (my cpu is i5-3550), so I downloaded last PAPI version. I followed instructions contained in the archive to install it (./configure, make and make install) and it ...
0 votes
0 answers
173 views

Installation from a .c file

I am trying to install a program that is installed from a single ANSI-C-file. However, the instructions that they give in the manual don't seem to work on Ubuntu. The manual reads: The source solvate....
-2 votes
1 answer
290 views

How can I install BCL (basic compression library)?

I want to install bcl (basic compression library) I need to copy a file into the C compiler’s (gcc) lib directory, and copy a header file into the compiler’s (gcc) include directory. I want to know ...
3 votes
3 answers
8k views

How to compile c & c++ programs?

I read somewhere that I need to install 'build essential packager' & so I tried: sudo apt-get install build-essential Reading package lists... Done Building dependency tree Reading state ...
9 votes
3 answers
172k views

How to fix compilation errors that mention "stray ‘\342’" and "stray ‘\200’"? [closed]

I wrote this program: #include<stdio.h> int main() { printf(“Hello World\n”); return 0; } I saved it as first.c and tried to compile but receiving this problem I have installed even gcc ...
2 votes
1 answer
5k views

Do we have to write our own arpa/inet.h? [closed]

#include <stdio.h> /* standard C i/o facilities */ #include <stdlib.h> /* needed for atoi() */ #include <unistd.h> /* defines STDIN_FILENO, system calls,etc */ #include &...
0 votes
3 answers
15k views

Netbeans for C++ (gcc 64bit)

How can I make Netbeans work with the GCC 64 bit compiler?
2 votes
0 answers
59 views

Lean C development environment on Ubuntu 14.04 [duplicate]

I need a very lean system with minimum of packages installed for development in C programming language. I know about build-essential meta-package but it's too big for my intents as I'm just working ...
3 votes
3 answers
1k views

How can I compile a C program file which I created using the Libre Office editor?

I'm new to Linux and I need some help! I am trying to compile the code taken from this post to the linux-kernel mailing list. I have pasted the file into Libre Office and saved it as pairing_tool.c ...
25 votes
6 answers
35k views

Source code formatter/indenter

I'm using Ubuntu 12.04. I do not have any root or sudo privileges as this is a company machine. Is there, in a normal installation of Ubuntu 12.04, any terminal program that I can use to turn ugly ...
19 votes
3 answers
40k views

What is the use of /usr/include directory?

I'm very new to Ubuntu. I'm looking at the directory /usr/include it contains lot of header files. I know they have specified certain constants and other information that are used in Ubuntu. I'm ...
0 votes
2 answers
2k views

bash - can shellcode be made from a bash script?

I was thinking it can't, since there's not really a binary for bash scripts, but having to write a C program every time you need to generate shell code for a single command is just a pain.
0 votes
0 answers
4k views

Fix Compilation Error: stray \200 , stray \213 and stray \342?

Here is a simple code that adds two numbers in each thread and then gives total balance in the end: #include <pthread.h> #include <stdio.h> int currentBalance=100,newBalance=0,oldBalance=...
0 votes
1 answer
1k views

Making simple graphical programs without an X Server (alternatives to svgalib)

Is it possible to create simple graphical programs in C without an X Server. I'm talking about svgalib or libsvga. Is there another alternative library? But I can't get it on 16.04 LTS. I do wish to ...
1 vote
2 answers
13k views

Error: /tmp/ccOB6cIT.o: In function `main': example.c:(.text+0x4a) [closed]

I picked up the following code from a practice file #include <stdio.h> #include <pthread.h> void *kidfunc(void *p) { printf ("Kid ID is ---> %d\n", getpid( )); } int main(int count, ...
0 votes
1 answer
1k views

How can I run c files in sublime text 3 that takes user inputs? [closed]

I am using sublime text 3 for my coding work, but I am not able to build C files and take the user input in sublime text 3.So please help me.
2 votes
1 answer
3k views

Error when trying to install GPGME

I'm trying to follow this descrption for installing GnuPG interface on Ubuntu. The output of ./configure is checking for a BSD-compatible install... /usr/bin/install -c checking whether build ...
0 votes
2 answers
17k views

What is the Best Way to use & practice coding in C language on Ubuntu 12.04? [closed]

I want to learn C language . and i would like to know how I can practice it using Ubuntu 12.04 Is there any platform for it and if so how can I get it? Or can I learn it using the terminal?
7 votes
1 answer
432 views

How can I use apt-get to list all packages written in C?

Is there any way I can use apt-get to give me a list of all packages written in C, or that have C modules in them?

1
3 4
5
6 7
10