Questions tagged [c]

C is a general-purpose computer programming language used for operating systems, games and other high performance work and is clearly distinct from C++. Questions about programming in C are off topic and will be closed or migrated. Consider asking your question at Stack Overflow instead.

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

Returning values from linux binary [migrated]

First, let me say that I am very new to writing drivers so I apologize if my terminology is completely off. I am attempting to write a driver to control an LED and read back some registers on my FPGA ...
0
votes
0answers
8 views

Where does HOST_OPERATING_SYSTEM in uname.c comes from? [migrated]

While reading uname.c (in order to recreate it) I found a variable called HOST_OPERATING_SYSTEM (line 371). It's never mentioned in the same file (as Strg+f told me) and not in the dependencies of ...
0
votes
0answers
5 views

Determining available IP addresses from a list [migrated]

So I'm coding in C for a list of IP addresses, listed one above the other in a .txt file, which should be read, and simultaneously pinging them one by one. Now, my main concern is to select which ones ...
0
votes
0answers
5 views

Iteration of IP list in C [migrated]

I'm having some trouble coding in C an iteration, that's to be taken from a .txt file where there are several IP's listed one above the other in several lines. What I need to do is to print the whole ...
0
votes
0answers
18 views

Perf top reports symbol “__cpuidle_text_start” consuming 87% CPU time

I have powersave (C-states) disabled in BIOS and in the kernel config, however, CONFIG_CPU_IDLE is enabled, and related "__cpuidle_text_start" takes too much CPU time, while I am not really sure what ...
0
votes
0answers
34 views

How to add feature “don't copy when pressing command” in this c program—macPaste?

https://github.com/lodestone/macpaste https://github.com/lodestone/macpaste/blob/master/macpaste.c with this little project, i can copy a text to cilpboard with just select a text ,in macOS. this ...
0
votes
1answer
350 views

Systemd: “Session closed for user root”

I've written a C application that I would like run at boot. The software operation includes GPIO manipulation and an attached projection cape on the Beaglebone Black that I'm using. I ended up ...
0
votes
1answer
45 views

which partition should be set active in windows 10?

I accidentally made C: as active, but don't know which one was before. Should I set the System Reserved as active? System Reserved - (System, Primary Partition) Win-10 (C:) - (Boot, Page File, ...
0
votes
0answers
13 views

Eclipse and C11 functions

I have the following problem with eclipse (on Windows 10): It does not recognize threads.h nor does it recognize timespec_get or TIME_UTC (I included time.h). However, it does recognize the struct ...
0
votes
2answers
242 views

Can we store a whole string with the help of a single character pointer? If yes , How? [closed]

Here p is a character pointer not an array! Yet compiler gave no warning or error? char *p = "Vladimir";
0
votes
1answer
646 views

ALE not working despite passing correct flags to the enabled linters

I'm using VIM to program in C11. I'm trying to setup ALE but it seems that the linters can't find the headers, despite the correct flags are passed, such as -I /path/to/include. I'm using CMake, so ...
0
votes
0answers
33 views

How to plot a program file's inputs and outputs on MATLAB

I wrote a code on the Eclipse IDE in C that calculates the inputs and outputs of a Fourier Sine Series. I ran the code in the Cygwin Terminal and got the outputs I expected. I then wanted to make a ...
0
votes
0answers
64 views

Cygwin installed Windows 10, filepath updated, but gcc -v and cygcheck -c cygwin do not work in cmd/ terminal

Cygwin installed on Windows 10, filepath updated, but gcc -v and cygcheck -c cygwin do not work in cmd/ terminal. I'm just trying to get started writing C and FORTRAN programs and I've spent 75 ...
0
votes
0answers
50 views

MikroC Pro For AVR V 7.0.1 - File 'main.c' not found

I am using MikroC Pro for AVR for Atmel microcontrollers programming. Today I can not compile any newly created project. When i try to compile it, there are two errors. File 'main.c' not found main ...
0
votes
2answers
4k views

gcc: fatal error: no input files

I wrote this simple line of code and saved it in a file called 'ex.c'. The code is the following (first line is purposely written wrong as it showed up different in the post): "#include < stdio.h &...
1
vote
2answers
979 views

Visual Studio Code doesn't run code

Why VS Code doesn't want to run code when I use scanf() function to get user's input knowing that without this function the code runs perfectly.
13
votes
1answer
4k views

How does the OS tell whether an “Address is already in use”?

If my C program uses sockets, binds to localhost:9025, exchanges some data, gets manually killed and restarted, it sometimes crashes with the error being: Address already in use. All SE-...
0
votes
2answers
538 views

Access Denied when compiling c code with gcc

I compiled my c program with gcc -c -o test.exe test.c and it compiled with no errors and then when I run it gives Access is denied. This is my code #include <stdio.h> int main() { printf("...
0
votes
1answer
298 views

How to troubleshoot C / C++ not producing output in VS code?

I just followed the set up for C / C++ in VS code ( https://code.visualstudio.com/docs/cpp/config-mingw ), I found two strange things: In the "tasks.json" the code has this "command": "g++" which is ...
0
votes
0answers
45 views

How to alter Validity90 prototype in order to store your fingerprint in Ubuntu 18.04

I have a Lenovo T470 running on it ubuntu 18.04, i've tried various libs to store/register a fingerprint, but all libs can't recognize the Bus Device except Validity90. About Validity90 After the ...
0
votes
0answers
17 views

Is it possible to pack C develop environment to single file?

Is it able to pack components of least C compile environment (compiler, linker, header file, libc and so on) to single executable file? Also How do I do it? I would like to make a portable C compile ...
-1
votes
1answer
23 views

include statement uses in C/C++ IDE

What determines when a file needs to be copied into a c/c++ project, instead of just using a #include statement? And if the IDE has project options that let the user list directories to include, how ...
0
votes
0answers
16 views

Unknown type name 'RAWINPUTDEVICE'

I have a little chunk of c code running in a windows 10 environment that keeps erroring with error: unknown type name 'RAWINPUTDEVICE'. Here is my code: #include <stdio.h> int main() { ...
0
votes
0answers
56 views

GCC 7.4 Can't find header files

Hello i have a problem compiling some c code. I'm trying to use the sendfile syscall in linux, but the problem is when i include sys/sendfile.h it gives me error about the size_t variable type (in ...
0
votes
1answer
123 views

Version: 1.4.5 ./a.out: symbol lookup error: /usr/local/lib/libcjson.so.1: undefined symbol: floor

I've an error related to cJSON. I make and compile Ultralightweight_cJSON in Ubuntu 18. cJSON working fine but just little issue happen. When I use cJSON_AddNumberToObject(fmt, "width", 1920); ...
1
vote
0answers
47 views

undefined reference to `leveldb::Options::Options()'

i was follow the README file to build level db in windows, and i generated the leveldb.lib for windows, but when i use it in a test file, there is a error : undefined reference to `leveldb::Options::...
0
votes
2answers
767 views

How to add graphics.h header file in gcc compiler?

I want to print a pixel on the screen using C language. When I write code and compile it shows graphics.h:No such file or directory I found that gcc doesn't have the "graphics.h" header file. How ...
0
votes
0answers
11 views

Running RHEL 7.5 Can't Figure Out Version of MySQL Connector/C

I have been deep trying to get this working so bear with me. I have C modules using MySQL that I'm moving from HP-UX 11.11 to RHEL 7.5 (x86-64). MySQL makes what they call Connector/C which is a ...
1
vote
0answers
131 views

GDB suspended every time after run program

I try to debug my program using gdb, but gdb suspended every time after run program. $ > gdb -q ./main Reading symbols from ./main... (gdb) disas main Dump of assembler code for function main: ...
0
votes
0answers
107 views

Only one of the two ADC channels are being read in STM32F072CBT

I have a STM32F072CBT microcontroller. I am using 2 ADC channels to read: 1. PIR analog sensor 2. Ambient analog light sensor. I am reading correct PIR values but my problem is that the ambient light ...
0
votes
0answers
26 views

How to locate code causing overwrite of RAM containing function return addresses?

I have a problem with some C code compiled in Keil for a Microchip SAMD21 MCU (Cortex-M0+). My program goes into hard-fault mode when using a function in some parts of the code. By debugging using ...
0
votes
1answer
104 views

compiling openssh 5.5p1 with jpake exploit

I am having some trouble using the jpake exploit and compiling it with openssh 5.5p1 :https://github.com/seb-m/jpake/archive/master.zip This is the error I am getting: Screenshot
-1
votes
2answers
87 views

How to send custom messages between routers of same network

I have created a mesh network with 3 routers in which I have to exchange some small i.e less than 5 character message between the routers. All of my routers are running on openwrt so it's a Linux ...
0
votes
0answers
19 views

Eclipse insert missing header files for C and C++

I am sure that I used to use a magic key sequence, something like Ctrl+Shift+o in Eclipse, when coding C or C++. It would parse the current file and add any missing #includes required to make the ...
14
votes
3answers
5k views

Compiling C files on Ubuntu and using the executable on Windows

For some odd reason, make kept giving me tabulation errors when compiling on Windows, so I tried it on Ubuntu and it worked just fine. Now I would like to use the executable I got from compiling on ...
0
votes
0answers
668 views

MPLAB X IDE v5.15 - Variables not getting added to wacthlist while using XC8 compiler. Why?

When I click "enter new watch" and type 'a', nothing happens. Same problem when I try to add 'c'. For some reason only 'b' is allowed to be added to watch list. Why? How can I add all the symbols to ...
0
votes
0answers
25 views

SIM 800 module issue

I'm using a SIM 800 module to make voice calls. I need to manage and understand the status of the call in progress and for this I have seen there is the AT + CLCC command, of which I found some ...
1
vote
1answer
81 views

Openssl SSL_CTX_new is successfull but set errno to ENOSYS (Function not implemented)

The SSL_CTX_new() function works fine but something is strange it sets errno to ENOSYS. Documentation doesn't say anything about this : https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_new.html #...
1
vote
1answer
305 views

Why does my GCC compiler not compile C code?

I followed a YouTube tutorial for installing the gcc compiler on my Windows 10 machine. The install appeared to go perfectly. tutorial here. I then wrote a C program, which compiles and executes when ...
0
votes
0answers
51 views

Pointer address value truncated

I am facing core dump issue in my application code, application got dumped in frequent intervals(once in a month, not exactly). During the core analysis , i am able to identify that corrupted pointer ...
0
votes
1answer
547 views

Gentoo / Emerging the latest version of qtwebengine fails

Command: emerge qtwebengine COMMON_FLAGS="-march=native -O2 -pipe" MAKEOPTS="-j3" USE="-bindist" RAM: 4 Gb I have tried removing -pipe, and setting -j1, and also adding -jumbo-build to USE flags, ...
0
votes
1answer
122 views

Why Win16 application layout is behaving strangely under Win10 32bit?

I have an old C Win16 application that is behaving badly when run in Windows 10 32bit. Unfortunately, I do not have the source code for the application so I cannot debug issues from there. The ...
0
votes
0answers
816 views

What is “ DWARF error: could not find abbrev number 67”

I am trying to build library with cmake tool chain but facing with "bin/ld: DWARF error: could not find abbrev number 67" Could someone explain in which consequences this would occur
1
vote
0answers
84 views

My Visual Studio 2017 debug start button showing disabled

How can this be fixed? Program is unusable for me without this feature
2
votes
1answer
218 views

snmptrap V3 with net-snmp not working “usm: no match on engineID”

I am trying to send snmptrap from my centos machine to other centos machine. I am seeing the below in logs, snmptrap V3 with net-snmp not working "usm: no match on engineID" trace: sc_hash(): scapi.c,...
1
vote
2answers
125 views

sleep() never terminates on Linux

I wrote a piece of code in C, using sleep(0.01);. For some reason the machine froze, and according to the backtrace it seems that it hangs on nanosleep() or __kernel_vsyscall (). (gdb) bt #0 ...
0
votes
2answers
441 views

Encountered Bus Error while trying to run code in CUDA

This was the code that I was trying to run on my computer when I encountered this error. ./l [Vector addition of 10 elements] Bus error (core dumped) I tried this >>>> nvcc -o l ...
0
votes
0answers
19 views

How to install a tool by makefike only in the Ubuntu 18.10 system

I download a tool from the website. The readme file only show me that I can use make to install the tool in the unix system. The make file: # @(#)makefile 1.15 SOURCES= \ chi.o ...
0
votes
1answer
993 views

Clear command for serial terminal over UART

I'm sending cmd_clr_scr[] = { 27, 91, 50, 74, 27, 91, 72, 0 }; over UART to clear the screen and move the cursor to the upper left corner of the screen on my serial terminal (Putty). I have two ...
0
votes
1answer
33 views

C plotting library GR not working

I am trying to install C library GR [Link] on Ubuntu 18.04, after following the instructions to install, there is no error while installing but when using it gives the error : foo.c:2:10: fatal ...

1
2 3 4 5 6