DISCUSSION: Building C programs on Linux
This thread is to discuss the article titled: Building C programs on Linux
|
Looks nice. Hopefully java expierence will be helpful, I want to learn C and my school never has enough people sign up for the class to have it. Thanks
|
Looks good but my problem is that SuSE Office desktop does not come with a C compiler. What would be really useful for me is a section on how to get started if you don't have a C compiler.
|
??? what do you mean Suse does not come with a C compiler?
gcc is the GNU C compiler and it is packaged with Suse, last time I checked(up to SuSe 8) svar |
make comment:
under several flavors of unix make does not require tab characters in rules. They don't break anything if they are there. The other thing which confuses new folks : K&R, ANSI "styles" Code:
/* ----- version 1 */ Style 2 is "okay", style 1 is a no-no. A lot of examples I've seen that come with downloads were written in 1985 and look like version 1. While it doesn't REALLY matter, this is confusing as hell to newbies. You might want to consider adding a section talking about style. Plus, version 1 won't compile under cc -Aa on HPUX v11.0 for example. So, it can cause some issues down the road. |
a good subject
|
Although you begin the article saying it is inended for folks who know C but do not know how to build a program under Linux, you spend much of the article expplaining the simple C program. You spend very little of the article saying how building it is different in Linux. I have some 15= year old experience In C under DOS, Windows and Unix (a little). I was hoping to see this article show how to set up my environment under Linux and how some of the tools differ or have improved.
When I saw the first line in the 1st program as "#include" with no argument as to WHAT to include and your statement that it meant you were using the stdio library, I thought I was on the right track. However, gcc gives the expected errors on that line (yes, I named the file differently): inctest.c:1:9: error: #include expects "FILENAME" or <FILENAME> inctest.c: In function ‘main’: inctest.c:5: warning: incompatible implicit declaration of built-in function ‘printf’ I infer not that your article is wrong, but that your environment is set up differently. Specifically, I found some other articles referring to default includes but they did not help either. Now I don't mind; in fact, I like being explicit about my includes so this is not a big deal detail. What I would like to find though is some information that really IS about how building C programs in Linux is different from other environments. Any suggestions? |
how do i install simply mepis 2004 2.6.7.? HELPPPPPPPPP
|
Quote:
> = > < = < |
I understand the author's kind intentions, but this is a very poor article. I'm not sure how the LQ mods allowed it to be posted, and furthermore, i'm not sure why or how the author didn't preview his work, or check/fix any mistakes afterwards. I'm not referring to tricky or blind-eye mistakes, but big ones such as the #include bit on the top.
Furthermore, adding to the comments said above, this hasn't really shown us any differences between building a typical C program, and building a C program for Linux. And as an added suggestion, some outside links to more indepth tutorials for certain sections would do good. I hope this article gets fixed. It is valuable and it's needed in LQ. |
storage of temporary variables in C
where does the temporary variables gets stored while executing C program.
|
also, you don't need a makefile to use make's implicit rules
for simple C files: Code:
|
anyone know the coding for this progarmmes
i got 2 questions and i try to write codes for this. its dosent working propoerly. anyone know how to do coding for this questions. thanks
1) Instead of producing the summation of the given non-negative integer, modify this program and make it create only one thread that will calculate the factorial. When the thread finishes execution, the parent thread will output the factorial calculated by the child thread 2 ) Besides of producing the summation of the given non-negative integer, modify this program and make it create two threads. One thread is to produce the summation of the given non-negative integer; the other thread is to calculate the factorial. When the two child threads finish execution, the parent thread will output the summation and the factorial of the given non-negative integer |
Sri
Nice tutorial
|
help help :(
char c[20];
printf("\n\nPlease enter the name of the file: "); scanf("%s",c); printf("\nthe name you type is : %s\n",c); system("mkdir c"); problem now in line 5 ,it make the folder name as c not the string i have enter |
All times are GMT -5. The time now is 02:10 AM. |