Questions tagged [c]
C is a general-purpose programming language
487
questions
-1
votes
1
answer
1k
views
Setting an IP address for each terminal window
For my project I have to develop a TCP client server connection in c. I've done both files and they are both working with the localhost address 127.0.0.1. However, I´d like to run two server ...
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 ...
0
votes
0
answers
360
views
How do I use recode.h on ubuntu 14.04?
I'm unable to install fortune package on ubuntu 14.04, got this error.
plankinc@singhan-jenkins:~/fortune-mod$ make all
cd fortune && make CC='gcc' \
CFLAGS='-O2 -DFORTDIR="\"/usr/...
7
votes
5
answers
22k
views
C, C++ and Java IDE for Ubuntu [duplicate]
Is there an IDE which can run on Ubuntu that supports C, C++ and Java? I installed NetBeans, but it only supported Java. I installed the C/C++ package manually, but that package gives an error if I ...
0
votes
1
answer
71
views
can't execute my old file, same user, only rw [duplicate]
(use this trick, and didn't work's)
After reinstall my ubuntu from 16.04 to 14.04. My C program can't be executed. My username is the same.
I have used:
chmod +x ./hello
chmod -R 775 hello
I am ...
0
votes
1
answer
12k
views
Decoding Key Values from /dev/input/eventx in C [closed]
I have created a keylogger in C that displays the raw key values from an input device. I am wondering how I would go about decoding hese values into ascii characters? Here is my code so far:
#include ...
0
votes
1
answer
1k
views
Gnome-terminal access with in c [closed]
I'm trying to write a C program to open separate terminal and ping google.com
#include<stdio.h>
#include <string.h>
int main()
{
char command[50];
strcpy(command,"gnome-terminal -e 'sh -...
0
votes
2
answers
3k
views
-Wall: command not found
im trying to compile two files on my bash : Main.c , DB.c
this is how i compiled them and they gave me no errors : gcc -c Main.c DB.c`
so they should have created Main.o and DB.o .
now im trying ...
1
vote
1
answer
6k
views
Is ctype.h installed in my system?
I am running 16.04. My C program uses isdigit(int). I get the following when I run it under gdb:
`Breakpoint 1, check_tok (token=0x6f7c20 <tokens> ".t") at outline.c:150
150 unsigned char *tp=...
0
votes
1
answer
160
views
Runing C program in Terminal [duplicate]
If I have a program written in C, how can I run this program in a terminal with just a single word (the program's name), no matter where it is on the system?
0
votes
1
answer
369
views
C programming in Ubuntu SnappyCore
I recently downloaded ubuntu snappycore OS. I wonder if i can install a GNU compiler for developing C applications. If I can, how do I do it?
3
votes
4
answers
26k
views
collect2: fatal error: cannot find 'ld' compilation terminated
When I try to run C and C++program I am getting
collect2: fatal error: cannot find 'ld' compilation terminated.
I have already installed GCC and G++ latest version.
-3
votes
1
answer
1k
views
Help with FUSE filesystem [closed]
I am new to Ubuntu and I need to create a FUSE based file system. I've seen many examples online, but I can't understand the differences between the examples. Some examples from what I've seen so far ...
82
votes
2
answers
4k
views
How do I write a Unity system indicator in Python?
Background:
This is NOT for application-indicators but system-indicators.
Picture from: https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators
The objective is to show indicator-...
0
votes
1
answer
191
views
C Source to .Snap [closed]
Source is in C. Requires multiple dependencies to successfully make.
This will not appear in the app-store. There is no GUI component.
This application is designed to run on a specifically-...
3
votes
5
answers
30k
views
how to code in ubuntu? [closed]
I used turbo c++ in windows to write c/c++ codes. Recently I started using Ubuntu, now where should i write c/c++ code in Ubuntu like we used to do in windows? Which software should I download from ...
0
votes
1
answer
332
views
"bash: ./cents: no such file exist or directory" while trying to run a program that has already been compiled
Can someone explain to me why this happens? It compiles the program fine but it wont let me run it. I'm on ubuntu 16.04
Bonus question:
How can I run the math library on Geany? I love the interface ...
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 (...
0
votes
1
answer
3k
views
I want to compile C file
I want to compile c file. I use g++ <filename> -o <output-filename>
Error: ch34x.c:13:24: fatal error: linux/init.h: Directory or file doesnt exist.
(here is hash I cant type here)include ...
-5
votes
1
answer
767
views
A c program works well in Ubuntu but when I compile and run it in windows using MinGW, the program runs but in result it shows some garbage value [closed]
I a wrote a C code in Ubuntu 14.04.4 LTS and compiled it. It is working as expected.But in windows it is running but at last in result it is showing some garbage values.
The code I wrote is
#include ...
0
votes
1
answer
447
views
C compile error [closed]
when I try to compile my code I get this error :
error: expected declaration or statement at end of input
}
and error: function declaration isn’t a prototype [-Werror=strict-prototypes]
void ...
10
votes
2
answers
13k
views
lint: command not found
Does Ubuntu have a lint utility? How is it installed?
In computer programming, lint is a Unix utility..
https://en.wikipedia.org/wiki/Lint_%28software%29
thufir@mordor:~$
thufir@mordor:~$ gcc ...
0
votes
2
answers
141
views
What is the meaning of this error: "Problem accessing file status"? [closed]
I am compiling in terminal a c code and when I am trying to run it I got this error.
Is there any specific meaning?
and how I can fix it?
2
votes
0
answers
181
views
Questions regarding AppIndicator
I am trying to build a JNI wrapper for using Ubuntu's AppIndicator in a Java application. I have some experience in C/C++, though no experience in GTK and Ubuntu development.
I have already done some ...
1
vote
1
answer
7k
views
Clion "Bundled Cmake does not work in this enviroment" ubuntu 14.04
I used Eclipse CDT for college lectures, but today I found the solution for C/C++ by JetBrains.
But I can't compile because I don't know how to set the compiler.
-1
votes
1
answer
792
views
How to get the current battery statistics using a kernel module? [closed]
I am using Ubuntu 14.04LTS. Can anyone give me some pointers on how to get the current battery level and the charging status of the laptop using a kernel module. If possible please attach the Makefile ...
-1
votes
1
answer
8k
views
running shell script using c program [closed]
I wrote a script to hide user input during runtime it works as a simple script but i want to integrate into c program but gives following errors:
warning: missing whitespace after macro name
error: ...
6
votes
3
answers
6k
views
How to debug c programs by gedit?
Is it possible to debug our programs written in c by gedit text editor ?
If not, how can i do it ?
-1
votes
1
answer
994
views
How to install C compiler in version 15.10?
I've searched many methods, but couldn't find best C compiler. Earlier, I used Win7. In that, I've used Turbo C/C++ v4 compiler. It will open in DOSBox. So, I've installed DOSBox in Ubuntu 15.10. I've ...
16
votes
3
answers
101k
views
What is EOF and how to trigger it? [closed]
This is my C source code.
When I build it in Ubuntu, it starts to get characters but I don't know how to end the program, as it does not end by inputting ENTER or a carriage return.
What does EOF ...
0
votes
2
answers
3k
views
I need root to run ./a.out (C) program [duplicate]
cd /media/k4li/data2/C
gcc program.c
./a.out
running ./a.out:
bash: ./a.out: Permission denied
if I enter sudo ./a.out i get:
sudo: ./a.out: command not found
0
votes
1
answer
3k
views
Makefile giving error
I recently started learning C language on Ubuntu 15.10 .Today I learned about Makefile from http://c.learncodethehardway.org/book/ex2.html .But the problem is I keep on getting error
bharat@...
0
votes
1
answer
2k
views
Unable to compile in geany
Whenever I try to compile any file whether c , c++ or python in geany I get this error.
0
votes
2
answers
77
views
safe files in c on ubuntu 15.10 [duplicate]
I would like to write a Software and this Software have to save files in /usr/share/xy/. The Software would write and read this data with fprintf() and fscanf(). The owner of the directory /xy/ is ...
1
vote
1
answer
2k
views
C complier is not working
Well I am trying to build the dependencies between some scripts for the android-python27 project in order to integrate charm library in a apk.While I am running a script named pbc.sh I get the ...
0
votes
1
answer
530
views
The file descriptor is duplicated in the thread [closed]
My C source behaves strangely.
I use Ubuntu 14.04
I use two pthread.
And in each of pthread calls the open () and socket ().
Oddly, this file descriptor is duplicated in certain cases.
Why do ...
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
3
answers
3k
views
How do I compile a c program made in sublime text? [closed]
I am new to programming and I used sublime text but the gcc command dos not work and I need help to compile the code
1
vote
1
answer
1k
views
libhid.so.0: cannot open shared object file: No such file or directory
I am trying to install an old program from here
I can't seem to get it working it kicks back "shark: error while loading shared libraries: libhid.so.0: cannot open shared object file: No such file or ...
-1
votes
1
answer
186
views
Trashcan fatal error: no input files
I have to build a trashcan in shell. The trashcan has the following funktions: get(-g), put(-p) and remove from trashcan (-r).
So i tried to compile this (gcc -o trashcan.sh) but i got a fatal error: ...
1
vote
0
answers
876
views
Can't open shared library
I am trying to add a function i wrote in C into MySql, in the function I am using 'gmp' library, it compiles correctly and I copy the '.so' file to '/usr/lib/mysql/plugin/' and then log in to mysql ...
1
vote
5
answers
4k
views
How do I run my C program?
I am a newbie in C programming language. I am following a course right now, but I have a small problem which is run the file for testing.
I have opened gedit and I wrote those lines of code:
int ...
2
votes
3
answers
2k
views
How to install a stand-alone program
If I create the following program in C:
#include <stdio.h>
int main(){
printf("Hello World");
}
And then compile it like so:
gcc helloworld.c -o helloworld
Is there any easy way to ...
39
votes
2
answers
3k
views
How to develop a System Indicator for Unity?
This is not a duplicate of How to create Unity indicators?. I'm looking for system indicator not application indicator.
Backgound:
From these two questions:
How do I add or manipulate Application/...
0
votes
1
answer
102
views
A problem which I encountered in Eclipse [closed]
I have written a simple code in Eclipse/C Project as below:
#include <stdio.h>
typedef struct list
{
int data;
struct list *next;
};
list Listptr;
int findTheSmallest()
{
}
int ...
3
votes
2
answers
4k
views
Why CLOCK_TAI and CLOCK_REALTIME returns the same value?
On my Ubuntu 15.04 (Linux Kernel 3.19.0-28-generic) I get the same value when requesting CLOCK_TAI and CLOCK_REALTIME with clock_gettime(). This is apparently an error because the difference between ...
1
vote
0
answers
2k
views
How do i save a c program using geany? Error: The file on disk may now be truncated
Everytime I try to save a file in my usb Ubuntu using Geany, it gives me the following error message :
Error opening file '/home/ricky/INT/1406641703/Lab02/Hallo.c':
Permission denied
The file ...
-1
votes
1
answer
213
views
How to build native RXTX library for Ubuntu12.04/14.04?
Can someone give me a tip on how to build the native rxtx library on Ubuntu 12.04/14.04? We need to run on 12.04 but i develop on 14.04.
I grabbed the source files from here:
http://rxtx.qbang.org/...
0
votes
2
answers
2k
views
Problems with su: Authentication Failure
I am currently using Ubuntu and am 100% new to Unix. I have installed Ubuntu to program in C and will be using the "Learn C the Hard Way" online textbook (http://c.learncodethehardway.org/book/ex0....
1
vote
1
answer
400
views
Monitoring resource usage by single application over period of time
I am looking for an utility which can monitor the resource usage (CPU & RAM) by an application.
I have an third party application which runs as service, once started, it will receive requests ...