Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c]

C is a general-purpose programming language

2
votes
2answers
49 views

I get a Blinking Cursor insread of an Output when running the C program in Ubuntu.

Here's my code for finding the distance between two points. My assignment makes it mandatory to make use of functions, hence a separate one for finding the distance. I don't get any syntax errors but ...
-1
votes
1answer
50 views

how do we compile and run a haskell program on terminal? [duplicate]

I have my program saved as prog.c how do I compile it and run it?
0
votes
1answer
60 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){ ...
0
votes
0answers
19 views

How do I use a Dialog input box to take integer and store it in C? [duplicate]

I am trying to use Dialog from within a C program to prompt the user to enter an integer. How do I store that entry in a variable within my program? An example of a Dialog yesno prompt I am using ...
-1
votes
1answer
160 views

Unable to locate package libesd0-dev on Ubuntu 18.04 [duplicate]

I used: sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-2.0 \ guile-2.0-dev libsdl1.2debian libart-2.0-dev libaudiofile-dev \ libesd0-dev libdirectfb-dev libdirectfb-extra libfreetype6-...
0
votes
1answer
52 views

How to create Ubuntu graphic C programs without Gtk?

Is there some sort of program or something to turn your text program graphical in C? Thank You, CCM
1
vote
1answer
53 views

ubuntu, syntax error near unexpected token `('

I want to run a c program on ubuntu 18.04, on a virtual machine, and I get this error: ./test.c: line 3: syntax error near unexpected token `(' ./test.c: line 3: `void main(int argc, char** argv)' I ...
0
votes
0answers
25 views

Use curses to execute separate code

I am trying to create a simple GUI that will let the user execute a separate, standalone C program. The program is mildly complex but self-sufficient. Once it gets executed, it'll perform everything ...
0
votes
1answer
62 views

netbeans missing native build tools

My Goal I want to have a fully functioning NetBeans C/C++ on my ubuntu 18.04 A small background The first problem I've encountered was build host not connected after a little research I've ...
0
votes
2answers
120 views

<fcntl.h> No such file or directory

I am trying to run the available C code at GitHub for bloom filter (https://github.com/jvirkki/libbloom). When I try to compile I get an error: fcntl.h No such file or directory. I am using Ubuntu 16....
1
vote
1answer
17 views

Free heap memory

So I'm using Ubuntu for programming I use atom text editor with gcc compiler for C. I want to ask what will happen if I don't clear memory allocated by malloc or calloc? Will the OS take care of it or ...
2
votes
2answers
64 views

Building git package and trouble with CMake

I'm trying to build finalhe and exfat-nofuse. It's my first time trying something of that sort. I'm using lUbuntu 18.04. I tried following info found on the finalhe GitHub page and these links: https:/...
0
votes
1answer
19 views

How does Ubuntu formats any flash drive with file systems in terms of Code?

I was thinking how can we design a file system of our own for study and experimental purpose. But for doing that I am not able to find proper documentation and resources. I also want to know even if ...
0
votes
1answer
19 views

Find latest modified *.c file and compile it within terminal with pipelining?

Lately I have coded a little bit more with the terminal in Linux to get a deeper understanding of programming. Right now I am trying to automatize the compiling process with the following command: ...
0
votes
1answer
61 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
1answer
65 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
2answers
223 views

libavcodec - codec not found

I am trying to run this program from ffmpeg c documentation. It is compiled successfully. But showing "codec not found" when I am trying to execute. I am using below command to compile. gcc -o ...
1
vote
1answer
45 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 ...
0
votes
0answers
31 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
1answer
83 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?
0
votes
1answer
141 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
1answer
332 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
0answers
104 views

sublime text does not open

I've installed sublime text 3 using the instructions from this question, but after doing subl it doesn't open anything.... I am trying to open C files. It doesn't do anything:
0
votes
1answer
165 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 ...
1
vote
1answer
34 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/...
1
vote
1answer
555 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
0answers
31 views

Trouble with connection mongodb to c project

IDE: Netbeans Error message I downloaded mongodb c driver and installed it using instruction from official site, but now when I trying to compile my project I get an error: ...
0
votes
0answers
302 views

Code::Blocks collect2 ld returned 1 exit status but it's working on Windows

I am using Xubuntu 17.10 with Code::Blocks 17.12. I am writing a program, with linked libraries (.a files), that I linked in project/build options with a relative path. On Windows, there's no problem,...
1
vote
0answers
116 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 ...
0
votes
0answers
177 views

Can't run CloclWorkMode Tether app in ubuntu

I have been trying for few hours to run CloclWorkMode Tether app for ubuntu. So I followed the instructions given by the application itself. My problem is when I try to make node modules before ...
4
votes
1answer
425 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
1answer
79 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 ...
1
vote
1answer
562 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
0answers
29 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 ...
4
votes
2answers
6k 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 ...
0
votes
0answers
111 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 ...
0
votes
0answers
892 views

How to resolve: undefined reference to `pthread_create' while running cmake command in cura-build

I have an ubuntu machine to run cura-build from the following doc. Refer: https://github.com/Ultimaker/cura-build#ubuntulinux My gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) while ...
0
votes
0answers
334 views

Trouble Installing SNMP Agent on Ubuntu 16.04

I am trying to Install the SNMP Agent on Ubuntu by using the following command sudo apt-get install snmpd But i am getting the following error. Setting up snmpd (5.7.3+dfsg-1ubuntu4) ... update-rc....
1
vote
1answer
2k 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
1answer
251 views

GCC -std=gnu99 error

I'm trying to compile a C code with this command gcc -Wall -m32 -std=gnu99 -o <filename> <filename> Instead of getting an output file, I get this. /usr/bin/ld: cannot find Scrt1.o: No ...
0
votes
0answers
251 views

Add New user and password with sudo permission in Linux programmatically [duplicate]

Add New user and password with sudo permission in Linux using programmatically in C or C++ language. Exist solution like How can I add a new user as sudoer using the command line? ,In this case you ...
0
votes
0answers
43 views

How to include ssl lib when running apxs on ubuntu

I am compiling my apache c module using this: sudo apxs -i -a -c mod_ex.c now I need to use the lib openssl. what should I use to include this lib? I tried with adding -I /usr/include/openssl but ...
2
votes
2answers
230 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 ...
4
votes
1answer
853 views

C/C++ option not available in NetBeans

I just upgraded just Ubuntu 14.02 to Ubuntu 16.04 and found that NetBeans was no longer working now. So I used: sudo apt install netbeans Now when I open the newly installed NetBeans, it does not ...
2
votes
1answer
813 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
3answers
605 views

Compiling C codes in Ubuntu

I'm a rookie programmer and trying to compile a C code in Ubuntu. I already installed GCC. How do I proceed from here?
1
vote
0answers
282 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....
1
vote
0answers
353 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, ...
0
votes
0answers
81 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 ...
3
votes
1answer
1k views

How to compile C GTK3+ program in Ubuntu for windows?

I am using and gcc-7 and mingw-w64.I want to compile a c gtk3+ program in Linux using mingw so that it will produce .exe file which can be run in windows.I am able to Compile normal c programs using ...