gcc compiler and c programming

Chat about just about anything else

gcc compiler and c programming

Postby launcherx on Thu Dec 04, 2008 10:54 pm

Well, I am a current and new user to this version of Linux. I have decided to use the Linux platform to start C programming. Where I am, Windows OS is the norm, but I prefer deviating from that.
I have been reading a book called 'C for Dummies', which is worth the read and also fun. I have started only recently, and yes, I am a noob with the whole C programming, and programming in general. I noticed that gcc is built into the Linux OS, so I had no need to get myself any additions. On my Windows OS, I needed something called 'Dev-C++', but the thing is that it didn't work on Vista and the same can be said for Windows XP and below (sometimes). I have learned the way of the Command Prompt or Console/Terminal, as a way to compile using gcc, after editing the source code using just a text editor like 'NotePad' or 'gEdit'. It's a rather tricky process to get gcc recognized in 'Command Prompt' on Windows, so Linux was my answered prayer.
I managed to do the basic, if you will, source code (beginners styled stuff), but upon compiling with gcc, I got a weird error, which is attached to this post.
The error received from gcc
screenshot.jpeg (49.19 KiB) Viewed 2563 times

Now, I can tell you, honestly, that I followed every step in the book, and I even modified the code to display something else, but that error came up. I rechecked, recompiled, same thing. I noticed that it happened when I was using the LiveCD for Linux Mint Elyssa, and even when I installed it to the hard drive it happened. However, after some time, the error subsided. I am wondering if this is some kind of bug in the gcc compiler or the linker or something else of the sort? Has this ever happened to anyone before? Note, I followed everything word for word, with nothing out of place in terms of necessary punctuations/symbols. The error subsided after some update was made to Elyssa for my video card (which I found strange, since the error came about long before that.... and I am certain that C programming has nothing to do with updating video cards drivers or its associated packages.. or maybe it does?)
Oh well, looking forward to a few responses, if any.
Level 1
Level 1
Posts: 1
Joined: Thu Dec 04, 2008 10:25 pm

Linux Mint is funded by ads and donations.

Re: gcc compiler and c programming

Postby piratesmack on Thu Dec 04, 2008 11:03 pm

What does your source code look like?
Sounds like you don't got the "< >" around stdio.h

Should look something like this:
Code: Select all
#include <stdio.h>

int main(void)
printf("Hello World!\n");
printf("Thank you piratesmack I love you!\n");
return 0;
Level 5
Level 5
Posts: 711
Joined: Mon May 26, 2008 3:08 pm

Return to Open chat

Who is online

Users browsing this forum: mike acker and 2 guests