LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-30-2014, 11:01 AM   #1
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, (Which Exit LOL), USA
Distribution: Centos 6.7 Under VMware in Win7
Posts: 473

Rep: Reputation: 34
C Program Source in one library on Object in a different library.


My previous post was well answered but some what above my head.

Can anyone tell me how to compile a C program which exists on one library ... which I call the Csource library and have the output go to my Cobject library using the GCC compiler option.

Thanks
 
Old 09-30-2014, 02:17 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,839
Blog Entries: 12

Rep: Reputation: 2010Reputation: 2010Reputation: 2010Reputation: 2010Reputation: 2010Reputation: 2010Reputation: 2010Reputation: 2010Reputation: 2010Reputation: 2010Reputation: 2010
You can use pathnames with the gcc command.
Code:
$ cd test
$ ls
test.c objects/
$
$ cd ..
$ gcc test/test.c -o test/objects/test.o
$ ls -R test
test/:
test.c objects/

test/objects:
test.o
 
Old 09-30-2014, 09:00 PM   #3
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, (Which Exit LOL), USA
Distribution: Centos 6.7 Under VMware in Win7
Posts: 473

Original Poster
Rep: Reputation: 34
Thanks again rtmistlr. Just what the doctor ordered ... worked great thanks again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Shared object constructor not called when library loaded adevi003 Programming 2 10-12-2009 05:51 AM
install from source - unable to find the libcurl library - but library is installed pulper Linux - Newbie 2 02-23-2009 10:00 PM
Need a library that contains the object bsd_ioctl Thomas Wagner Linux - Software 1 01-30-2009 08:53 AM
Shared object library that uses another shared object library Nightfox Programming 1 02-15-2006 11:00 PM
shared object library won't load (libstdc++) sleepylight Linux - General 4 04-27-2004 05:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:13 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration