Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed GCC with apt-get.

How can I check that it is installed correctly and which version?

share|improve this question
    
#include <stdio.h> int main() { printf("Hello, world!\n"); return 0; } Then, open a terminal and change directory to where you created the file, and run this: gcc test.c -o test ./test –  hadi Apr 11 at 5:44

2 Answers 2

up vote 4 down vote accepted

Just type on the commandline:

gcc -v

share|improve this answer

Or you can also create a Hello World to see if it links and compiles properly. Create a file named test.c with the following in it:

#include <stdio.h>

int main() {
    printf("Hello, world!\n");
    return 0;
}

Then, open a terminal and change directory to where you created the file, and run this:

gcc test.c -o test
./test

If it prints Hello, world! on the terminal, it's properly installed and ready to compile.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.