Q. I've a c program and I'd like to run in Linux.
A. C program need to compile and run in Linux using cc or gcc command. When you invoke GCC (GNU C Compiler), it normally does preprocessing, compilation, assembly and linking for you. For example to compile hello.c program , type the following command:
cc -o hello hello.c
OR
gcc -o hello hello.c
It will compile and produced an exectuable file called hello. To run program type:
./hello
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -


{ 3 comments… read them below or add one }
Hello All,
I need help. I have a ‘C’ program that was compiled on SCO OpenServer 5.05 and now want to compile on Linux Red Hut. This is failing to compile. Here is part of the program:
#define MENU_WD 5
#define MENU_HT 19
#define MENU_HP 27
#define MENU_VP 5
#include
struct s_menus{
int ops;
int y,x,w,o;
int ptr;
char title[20];
char *options[10];
};
typedef struct s_menus MENU;
MENU m;
main()
{
int i;
char a[20];
InitialiseAll();
menus_ini(&m);
menus_op(&m, “Student Records”);
menus_op(&m, “Chameleon 2000″);
menus_op(&m, “Change Password”);
menus_op(&m, ” Exit”);
menus_title(&m,”UNZA”);
i=menus(&m,5,27,5,19);
clear();
refresh();
endwin();
}
How can I make this compile and run ?
Thanking you in advance.
Felix Mwango Mutale
Try adding a header file to #include eg: #include
main() has to be declared with a return value eg: void, int, char,
put int main(){}
compile now and see what happens.
Dear Sir,
I have been struggling to get bold letters in informix for CentoS 4.8 and how can I use PCL Command Sequences to solve this problem ?
I have the following declarations and print command in my informix-4gl but things don’t seem to get right.
BoldOn CHAR(6),
BoldOff CHAR(6)
—-LET BoldOn = ASCII 27, ASCII ‘&040′, ASCII ‘&115′, ASCII ‘&052′, ASCII ‘&066′
—-LET BoldOff = ASCII 27, ASCII ‘&040′, ASCII ‘&115′, ASCII ‘&048′, ASCII ‘&066′
LET BoldOn = ASCII 27,”(s4B”
LET BoldOff = ASCII 27,”(s0B”
PRINT COLUMN 1, BoldOn CLIPPED, ” “, “TO WHOM IT MAY CONCERN”, BoldOff,
COLUMN 54, BoldOn CLIPPED, ” “, “Ref: “, BoldOff CLIPPED, r_refno
PRINT COLUMN 1, BoldOn CLIPPED, ” “, “This is to certify that: “, BoldOff, r_surname, ” “, r_firstname
and this what I am getting:
^[(s4B TO WHOM IT MAY CONCERN^[(s0B ^[(s4B Ref: ^[(s0B 9844510
^[(s4B This is to certify that: ^[(s0B NAMONJE CAROL
^[(s4B is a registered student of the National Institute of Public Administration^[(s0B
We have HP LaserJet P3005 and P3015 Printers.
How can I avoid printing these charaters and instead print Bold letters ? Are there any settings I need to do in Environmental variables or CUPS settings ?
Your help will highly be appreciated.
Felix Mwango Mutale