Compilation in C: ld returned 1 exit status
mancini
-
guiguidi77 -
guiguidi77 -
Hello,
I’m learning to program in C. I’m using the DEv-C++ IDE
here is my code :
/*
Below are preprocessor directives.
These lines allow adding files to the project, files that we call "libraries".
Thanks to these libraries, we will have ready-made functions to display, for example, a message on the screen
*/
#include <stdio.h>
#include <stdlib.h>
/*
Below is the main function of the program, called "main". It is through this function that all programs start.
Here, my function simply prints "Bonjour" to the screen, pauses the program and then stops
*/
int main(int argc, char *argv[])
{
// start of the function
//declaration and initialization of a variable
long nombreDeVies= 5;
// declaration and initialization of a constant
const long NOMBRES_DE_VIES_INITIALES=5;
printf("il vous reste %ld vies",nombreDeVies);
printf("***** BAM*******\n");//he just got a big hit on the head
nombreDeVies = 4; // He just lost a life!
//printf("Ah desolé, il ne vous reste plus que %ld vies maintenant !\n\n", nombreDeVies);
system("PAUSE"); // The program pauses
return 0; // The program returns the number 0 and then stops
}
when I try to compile and run
that gives me this error:
Permission denied
ld returned 1 exit status
thanks for any help.
I’m learning to program in C. I’m using the DEv-C++ IDE
here is my code :
/*
Below are preprocessor directives.
These lines allow adding files to the project, files that we call "libraries".
Thanks to these libraries, we will have ready-made functions to display, for example, a message on the screen
*/
#include <stdio.h>
#include <stdlib.h>
/*
Below is the main function of the program, called "main". It is through this function that all programs start.
Here, my function simply prints "Bonjour" to the screen, pauses the program and then stops
*/
int main(int argc, char *argv[])
{
// start of the function
//declaration and initialization of a variable
long nombreDeVies= 5;
// declaration and initialization of a constant
const long NOMBRES_DE_VIES_INITIALES=5;
printf("il vous reste %ld vies",nombreDeVies);
printf("***** BAM*******\n");//he just got a big hit on the head
nombreDeVies = 4; // He just lost a life!
//printf("Ah desolé, il ne vous reste plus que %ld vies maintenant !\n\n", nombreDeVies);
system("PAUSE"); // The program pauses
return 0; // The program returns the number 0 and then stops
}
when I try to compile and run
that gives me this error:
Permission denied
ld returned 1 exit status
thanks for any help.
9 answers
A few questions.
Do you have the same problem with other programs compiled with DevCPP?
When you say that you cannot rename or delete the .exe, is it Windows that refuses on a flimsy pretext?
If the two answers are yes, it is possible that the compiler is poorly installed (exe or lib). so reinstall it.
if the answer to the first is no, it is possible that it comes from the source.
--
Salutations! When in doubt, don’t touch!JBT
Char Snipeur
Do you have the same problem with other programs compiled with DevCPP?
When you say that you cannot rename or delete the .exe, is it Windows that refuses on a flimsy pretext?
If the two answers are yes, it is possible that the compiler is poorly installed (exe or lib). so reinstall it.
if the answer to the first is no, it is possible that it comes from the source.
--
Salutations! When in doubt, don’t touch!JBT
Char Snipeur