Where is executable file after compiling a c program in ubuntu? [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 3 years ago.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
While compiling a C file in windows I get three files a .c file a .o file and a .exe file, now if i want to distribute my program I will give .exe file. But after compiling a .c in ubuntu I can't find the executable file which will run directly on other system by just clicking it.

The default file name is a.out, but you can specify another filename with gcc a.c -o my_executable.

Related

"Access is denied" GCC C compile [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I know there have been similar questions but none of them seem to solve my problem. After successfully compiling my code, I got an "Access is denied." message from my command prompt after trying to run it (picture below).
The code I'm trying to run in a file named dummyC.c is:
#include <stdio.h>
int main (void) {
printf("Hello");
}
For context, I'm using Windows 10 64-bit. The GCC version (GCC -v) is MinGW 9.2.0, also in the attached picture. Is there any way I could solve this?
EDIT: The problem was my Avast antivirus flagging the output file a.exe as a Trojan or a virus. The problem was solved after I temporarily disabled all Avast shields.
I believe that your project is not in the correct place for the compiler to execute it, if it is on the desktop try to transfer it to a folder created in c:

How can I open a .nsi file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I have downloaded a .nsi file and now I have to launch this to get my missing Windows registry keys installed. I tried different things to open it but so far everything didnt work. Can anyone please tell me how to run this kind of files?
A .nsi file is an input to the process that creates an executable. You need the Nullsoft Scriptable Install System compiler: https://nsis.sourceforge.io/Download
More info: https://nsis.sourceforge.io/Simple_tutorials

How to convert a .o file back to a .c file in C? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm sure there's a way. I'm new to C and my research on this led me nowhere.
Is there a command that can convert a .o file to .c?
Usually you can only determine the assembly language for the object file, using a disassembler. Here are a few links to discussion on that topic, e.g., for objdump:
objdump - GNU Binary Utilities
Disassembling a binary in Linux
Using GCC to produce readable assembly?
Linux Interactive DisAssembler
Reverse-compiling (decompiling) is much harder. Here are a few links to help:
convert executable back to C source code
Reverse Engineering Resources - Decompilers
.o file has object code and cannot be converted back to its original .c file having high level code . It is just like the fact that chewed food cannot be converted back to its solid form.

Compiling c program with disable_irq and enable_irq error can't find lib linux/irq.h [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm trying to create a C program whose goal is to enable_irq and disable_irq.I have include linux/irq.h like that
#include <linux/irq.h>
And when I compile :
gcc myProgram.c -o myExecutable
I have the error : fatal error : linux/irq.h no file or folder find
What package I have to install? I'm on archLinux.
You cannot disable IRQs from a userspace application. Those functions are only available within the kernel.

Running a program (written in C) in Linux [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I'm using Ubuntu.
I wrote a program in C which interacts with a Mysql Database
The compilation process goes smoothly (excepts several warnings) and I get the executable.
How do I run it in Ubuntu?
I mean, I use this command :
gcc -o magazzino main_magazzino.c -L/usr/include/mysql -lmysqlclient
How do I run magazzino?
if it is in the current directory, run ./magazzino
Usually:
./magazzino
The dot and slash are to tell the shell that you mean the executable in this current directory - otherwise it would search for the program in its $PATH and probably not find it. (Although it's possible to have the current directory in your PATH, this is a bad idea and not recommended for security reasons.)
Just use
/path/to/magazzino
And if your current_folder is same with where magazzino stored use
./magazzino
In the directory type in,
./magazzino

Resources