05-26-2011, 07:55 PM
I have posted this in My Forums, So I think that the Info must be Shared, the same reason I posted it Here, all the Credits originally goes to Coded32, that is Me.
So, here is Coded32.
Today I am gonna Teach you something different.
Maybe that you are using Windows 7 and finding it difficult to compile your C Programs under x64 Versions and you may use DoxBox Emulator, But that does sux. In my opinion the whole Windows Operating system sux, so If you wanna go to the deeper to the programming grounds, you need a OS that fully supports something outta Programming.
Note : If you need to stick to Windows [Not Recommended for Programmers], Try "Pellas C Compiler" for Windows 7, that even runs and compiles under x64 versions, or try Doxbox.
Doxbox commands. You should have the Turbo C compiler installed beforehand.
The above code will Mount C drive as the default drive under which the execution takes place [change the drive according to your TC{Turbo C} Installation files.].
Now we go to the C: drive, find the Dir, and go under TC [The default location{folder name} for Turbo C compiler]., we then go to bin under TC where the TurboC executable file lies !.
and then it automatically prompts the editor. Done.
Now here is the Interesting part, most of the users may now turn to use linux as their Guide and I suggest that is the right choice :tongue: Okay first to compile your programs, you need to find the Terminal. The Terminal is equivalent to the command prompt in Windows, with more extra exclusive features. Find the terminal in Applications [View the tor left corner], go to "Accessories" , find Terminal and start it.
Now type the following : [Don't say that Coded32 teaches you half Lesson's ! ] Get a Net connection to update the C libraries.
It will Install all the Updates for the Ubuntu package, you have. I have used Ubuntu 9.10 as my Version [Karmic].
Then Get the C package that will run effectively under Linux ! Type the following !:--
That will install the essential files needed to execure, run, and compile the C programs you create under Linux.
Okay after that....type the following :
Where "sudo' is a r00t command in Linux. gedit is a default text editor in Ubuntu. coded32.c or whatever is the filename that you want to create and compile, it can be any filename but make sure you give the ".c" extension, because it is C programming if you have not forgotten.
Then it will open the editor --> a Text based... Type your program there, as this is the first program under linux you are gonna try, i will make the code simple. Type in the editor as follows.
Ok, now click the "Save" button so it saves under the current bash directory, I will tell about "Bash" later as that is not the business right now :smile: However proceed as follows.
Go the terminal [That is already opened], type :--
cc is the package here, more on that later. -c means the "compile' command". And replace the "coded32.c" with whatever the filename you give !
Ok, we successfully compiled a program, if you get any errors post here and i will solve. But now we have to get the Object file, If you dunno what is OOP language and what does "Object Linking" means, you need to seriously get a ebook on C or read your college notes !
Now type the following to link a Object, that should be created under the very dir you are in.
-o is the "Link Object" command. Remember don't copy/paste this commands, manually do it and replace the "coded32.c" with whatever you have as your filename.
A executable will will be obtained this way and now to run your program, do the following !--:
Replace the "coded32.c" with your filename.
That's all and you will get the output.
I hope you do the same and stick to Linux for better programming, IDE packs do the same but it looks Kid works to me :tongue: Coded32 here , seeya later !
Today I am gonna Teach you something different.
Maybe that you are using Windows 7 and finding it difficult to compile your C Programs under x64 Versions and you may use DoxBox Emulator, But that does sux. In my opinion the whole Windows Operating system sux, so If you wanna go to the deeper to the programming grounds, you need a OS that fully supports something outta Programming.
Note : If you need to stick to Windows [Not Recommended for Programmers], Try "Pellas C Compiler" for Windows 7, that even runs and compiles under x64 versions, or try Doxbox.
Doxbox commands. You should have the Turbo C compiler installed beforehand.
Hidden Content
The above code will Mount C drive as the default drive under which the execution takes place [change the drive according to your TC{Turbo C} Installation files.].
Now we go to the C: drive, find the Dir, and go under TC [The default location{folder name} for Turbo C compiler]., we then go to bin under TC where the TurboC executable file lies !.
and then it automatically prompts the editor. Done.
Now here is the Interesting part, most of the users may now turn to use linux as their Guide and I suggest that is the right choice :tongue: Okay first to compile your programs, you need to find the Terminal. The Terminal is equivalent to the command prompt in Windows, with more extra exclusive features. Find the terminal in Applications [View the tor left corner], go to "Accessories" , find Terminal and start it.
Now type the following : [Don't say that Coded32 teaches you half Lesson's ! ] Get a Net connection to update the C libraries.
Hidden Content
It will Install all the Updates for the Ubuntu package, you have. I have used Ubuntu 9.10 as my Version [Karmic].
Then Get the C package that will run effectively under Linux ! Type the following !:--
Hidden Content
That will install the essential files needed to execure, run, and compile the C programs you create under Linux.
Okay after that....type the following :
Hidden Content
Where "sudo' is a r00t command in Linux. gedit is a default text editor in Ubuntu. coded32.c or whatever is the filename that you want to create and compile, it can be any filename but make sure you give the ".c" extension, because it is C programming if you have not forgotten.
Then it will open the editor --> a Text based... Type your program there, as this is the first program under linux you are gonna try, i will make the code simple. Type in the editor as follows.
Hidden Content
Ok, now click the "Save" button so it saves under the current bash directory, I will tell about "Bash" later as that is not the business right now :smile: However proceed as follows.
Go the terminal [That is already opened], type :--
Hidden Content
cc is the package here, more on that later. -c means the "compile' command". And replace the "coded32.c" with whatever the filename you give !
Ok, we successfully compiled a program, if you get any errors post here and i will solve. But now we have to get the Object file, If you dunno what is OOP language and what does "Object Linking" means, you need to seriously get a ebook on C or read your college notes !
Now type the following to link a Object, that should be created under the very dir you are in.
Hidden Content
-o is the "Link Object" command. Remember don't copy/paste this commands, manually do it and replace the "coded32.c" with whatever you have as your filename.
A executable will will be obtained this way and now to run your program, do the following !--:
Hidden Content
Replace the "coded32.c" with your filename.
That's all and you will get the output.
I hope you do the same and stick to Linux for better programming, IDE packs do the same but it looks Kid works to me :tongue: Coded32 here , seeya later !