nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

How to compile a c program in freeBSD

This is a discussion on How to compile a c program in freeBSD within the All about FreeBSD/OpenBSD/NetBSD forums, part of the *BSD Operating systems category; Hi, Am new to this forum as well as freeBSD. Can some one please tell me how to go about ...


Go Back   nixCraft Linux Forum > *BSD Operating systems > All about FreeBSD/OpenBSD/NetBSD

Linux answers from nixCraft.


All about FreeBSD/OpenBSD/NetBSD Discuss all about the Rock solid FreeBSD/OpenBSD/NetBSD. You are free to talk about any issues related to BSD administration, networking, services and other stuff, share information or ask doubts.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 21-01-2008, 01:33 PM
Junior Member
User
 
Join Date: Jan 2008
OS: Debian
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
jkmb is on a distinguished road
Default How to compile a c program in freeBSD

Hi,

Am new to this forum as well as freeBSD.

Can some one please tell me how to go about compiling a c program with embedded informix SQL and get the exe?

Thanks in advance
JS
Reply With Quote
  #2 (permalink)  
Old 21-01-2008, 01:40 PM
Junior Member
User
 
Join Date: Jan 2008
OS: Debian
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
jkmb is on a distinguished road
Default

Hi all,
By mistake i have posted the same thread two times.
please ignore this thread.
Can the user close a thread?

Thanks in advance
jkmb
Reply With Quote
  #3 (permalink)  
Old 21-01-2008, 11:38 PM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 708
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
Default

Your file name is hello.c, type in same directory
Code:
make hello
Another option to compile
Code:
cc hello.c
gcc hello.c -o hello

To run
Code:
./a.out
./hello
__________________
Rocky Jr.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
  #4 (permalink)  
Old 22-01-2008, 02:55 PM
Junior Member
User
 
Join Date: Jan 2008
OS: Debian
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
jkmb is on a distinguished road
Default

Thank you for the reply
Reply With Quote
  #5 (permalink)  
Old 24-03-2008, 08:01 PM
Member
User
 
Join Date: Mar 2008
OS: Debian, Slackware, LFS
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2
Tux-Idiot is on a distinguished road
Default

echo "main() {}" > dummy.c && cc dummy.c -o dummy && ./dummy && rm -f dummy && echo $?
BSD's use csh (netbsd) and ksh (obsd, fbsd, nbsd) and the above command is for bash.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
compile a new kernel in RHEL 5 vikas027 CentOS / RHEL / Fedora 3 24-03-2008 09:56 PM
How to compile a c program in freeBSD jkmb All about FreeBSD/OpenBSD/NetBSD 0 21-01-2008 01:33 PM
sa-compile diptanjan Linux software 1 07-06-2007 07:07 PM
Kernel Compile mannrj45 Linux software 1 02-12-2006 08:32 PM
Dumb Newbie problem -- can't compile Henry Coding in General 7 12-01-2006 04:24 AM


All times are GMT +5.5. The time now is 05:32 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38