Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error While Compiling C program in Linux Mint

Tags:

c

gcc

ubuntu

ld

i am getting errors while compiling a simple C program.

#include<stdio.h>
void main()
{
      int i=5;
printf("I value is %d",i);
}

The Errors are ..

/usr/local/bin/ld: this linker was not configured to use sysroots
collect2: error: ld returned 1 exit status

my gcc version is..

gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.

Can anyone know what my problem is ?

like image 814
Siva Avatar asked Oct 05 '22 04:10

Siva


1 Answers

Following the tutorial below, the suggested to insert the path /usr/bin to the environment variable in the following way.

export PATH="/usr/bin:$PATH".

https://askubuntu.com/questions/347466/configure-error-c-compiler-cannot-create-executables

this worked for me.

like image 177
Reudismam Avatar answered Oct 06 '22 20:10

Reudismam