1 / 9

CprE 288 – Quick intro for compiling C in Linux

CprE 288 – Quick intro for compiling C in Linux. Instructor: Dr. Phillip Jones. Overview. Compile C code in Linux Linux Basics Logging in to Linux boxes from off-campus. Open a file. At the command line prompt type: gedit file_name_to_create &

suzy
Télécharger la présentation

CprE 288 – Quick intro for compiling C in Linux

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CprE 288 – Quick intro for compiling C in Linux Instructor: Dr. Phillip Jones http://class.ece.iastate.edu/cpre288

  2. Overview • Compile C code in Linux • Linux Basics • Logging in to Linux boxes from off-campus http://class.ece.iastate.edu/cpre288

  3. Open a file At the command line prompt type: geditfile_name_to_create & In this case I created a file called hw3_1.c The “&” is important. Without it you lose the prompt http://class.ece.iastate.edu/cpre288

  4. Blank File A gedit window should open Notice the name of you file on the tab http://class.ece.iastate.edu/cpre288

  5. Add your C code Don’t forget to SAVE In this case I just copied from Word Note: if you copy from Word the “ “ may not copy correctly. Just manually retype. See Next slide http://class.ece.iastate.edu/cpre288

  6. Add your C code http://class.ece.iastate.edu/cpre288

  7. Compile your code and execute it compile hw3_1.c and call the executable “test”. Output of the program. Note: I have not put any code for my_strcat Run the program that you just compiled called “test” http://class.ece.iastate.edu/cpre288

  8. Linux Basics • Some on-line tutorials and quick reference cards • http://trinity.senecac.on.ca/cadence-tutorial/Unix.pdf • http://www.ee.surrey.ac.uk/Teaching/Unix/ • https://www.cfa.harvard.edu/~jbattat/computer/linuxReferenceCard.pdf • How do I know where I am • pwd (tells you your current location, use this command often) • What is in my current location • ls (list all the files and directors at this location) • Changing directories • cd directory_name • cd .. (takes you up one directory level) • cd ~ (takes you to your home directory) • Making a new directory • mkdirnew_directory_name

  9. NX • NX is an application that allows you to access Linux machines from off campus. • It is very lightweight and can be typically installed in less than 5 minutes • You can download NX from the following links • For Windows: http://www.nomachine.com/download-client-windows.php • For Linux: http://www.nomachine.com/download-client-linux.php • For MAC OS: http://www.nomachine.com/download-client-macosx.php • For Solaris: http://www.nomachine.com/download-client-solaris.php • After you install the NX client, make sure to install any additional fonts that are available for your platform type. If you do not some application will not display properly • You can login to the following ISU Linux machines using your userID & password • Those listed here: http://www.it.eng.iastate.edu/remote • The ones that are NX capable will say NX in there list of applications.

More Related