LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 11-13-2008, 11:31 AM   #16
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492

You don't run a C source file, you compile it and then run the binary executable built in the process.

eg:
Code:
$ /usr/sfw/bin/gcc micro.c -o micro
$ ./micro
Thu Nov 13 18:31:05.008336 2008
 
Old 11-13-2008, 11:30 PM   #17
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Hey There,

I just double checked, and it looks like you're executing the C code, which needs to be compiled before you use it.

This simple command line should set you up:

gcc -o micro micro.c

This assumes you want your binary to be named micro (-o micro is the output file)

Best wishes,

Mike
 
Old 11-14-2008, 08:09 AM   #18
stuart_cherrington
Member
 
Registered: Aug 2008
Location: Get back in your Cube Unix Boy!
Distribution: rh5, oel5, debian etch, solaris
Posts: 228

Rep: Reputation: 36
Sorry but you need to go back and read the thread. The micro.c is an uncompiled Source file written in C Programming language. You need to compile the source code (using gcc), this will give you the compiled version which you then run.

Stuart.
 
Old 11-14-2008, 08:17 AM   #19
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I hope after reading all these replies more or less rephrasing the initial one I posted in #16, the OP will understand the mistake ...
 
Old 11-18-2008, 08:53 PM   #20
Jaxån
Member
 
Registered: Apr 2005
Location: Sweden
Distribution: Debian
Posts: 142

Rep: Reputation: 15
What you get it C programming language SOURCE-code that needs to be compiled to a binary file with machine instructions (and loader/linker instructions).

To compile this C-program, you need a compiler. There is one in Sun free software CD. If you install that compiler, it will end up in directory /usr/sfw/bin
To run the c compiler, that is named gcc, to compile your source code you need to write this in the same directory where you store the source code from a terminal.
Quote:
/usr/sfw/bin/gcc micro.c -o micro
Then it will create a runnable binare called micro in same directory. That file you can load and run with this command from same place.
Quote:
./micro
But this will not change any other programs way of showing the time on screen or in a log file.

Get a basic C programmers book and a basic Unix user book. You will need it to understand how Unix works.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Loging into Solaris for 1st time and changing default multiboot OS to windows Some Guy Solaris / OpenSolaris 5 05-04-2007 12:42 PM
Time format in boot-time messages jonr Linux - Kernel 1 12-22-2006 12:31 PM
Changing distro - how do I format Root ? dms05 Linux - Newbie 2 05-30-2006 08:20 AM
Downloading Solaris 10 and wondering how to format my HD! cereal83 Solaris / OpenSolaris 9 02-28-2005 02:18 PM
Changing Keyboard input into UTF-8 format LinuxTiro Programming 1 05-08-2004 09:29 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 12:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration