The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Carreer:Networking Programming in Unix (C programming Language) vibhory2j UNIX for Dummies Questions & Answers 5 09-05-2008 04:57 PM
Unix Systems Programming Vs Unix Programming BCarlson Shell Programming and Scripting 0 05-24-2006 11:34 AM
RPC Programming emeralddream High Level Programming 1 02-23-2005 08:34 AM
c programming or unix programming!? moxxx68 High Level Programming 1 03-30-2004 05:53 AM
Programming CreamHarry High Level Programming 3 03-07-2002 12:09 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-21-2002
Registered User
 

Join Date: Nov 2001
Posts: 2
c programming on vi

i am new in linux environment .I have used vi editor of Unix to get a programe compiled through "gcc ".kindly give me the options to get a program compiled & executed written in c on vi editor.

I want the command to compile a file and the command to get that compiled file executed with any example.
__________________
Rajeev Rai
Reply With Quote
Forum Sponsor
  #2  
Old 01-23-2002
Registered User
 

Join Date: Jan 2002
Location: India
Posts: 111
If u try this, it might work
1) Go to Command Mode By pressing ESC
2) Go to Ex Mode by pressing ":"
3) Issue the following command
:!gcc % -o <ObjFile> [-l library ] && ObjFile
or
:!gcc % [-l library ] && a.out

-o options lets u create a default object file instead of a.out. The first part of the command lets u compile C Code and the ('&&' ) the second part gets executed only when the first part exits with return status good. If so ,then 'ObjFile' will be created and the shell will execute the Object file else it will show u the errors and exit without executing the 'ObjFile'
__________________
Regards,
Satya Prakash Prasad
Reply With Quote
  #3  
Old 02-14-2002
J.P's Avatar
J.P J.P is offline
Registered User
 

Join Date: Nov 2001
Location: Sweden
Posts: 67
Thanks for that Prasad. works with g++ also of course

:!g++ % -o output && output
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:25 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0