How compile a library on solaris(like dll in windows) | Unix Linux Forums | Programming

  Go Back    


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

How compile a library on solaris(like dll in windows)

Programming


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-16-2003
zing zing is offline
Registered User
 
Join Date: Jun 2003
Last Activity: 16 August 2006, 9:18 AM EDT
Location: Bombay, India
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
How compile a library on solaris(like dll in windows)

Hi all,

how do i compile a c program into a library on solaris

Thanks in advance
Zing
Sponsored Links
    #2  
Old 07-16-2003
thehoghunter thehoghunter is offline
Registered User
 
Join Date: Jan 2002
Last Activity: 23 March 2005, 10:54 AM EST
Location: Florida
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
I believe it matters what compiler you are using. Read the man page for your specific compiler or search the 'Net.

For gcc - see this
link
Sponsored Links
    #3  
Old 07-16-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 30 July 2014, 10:25 PM EDT
Location: Ashburn, Virginia
Posts: 9,897
Thanks: 58
Thanked 415 Times in 249 Posts
The closest unix equivalent of a dll would be a shared library. Staring at the Solaris man pages, it looks to me like:
cc -KPIC x.c
cc -KPIC y.c
cc -KPIC z.c
ld -G -Bdynamic -o libxyx.so x.o y.o z.o

might work. But I don't have a Sun compiler to test it.
    #4  
Old 07-18-2003
zing zing is offline
Registered User
 
Join Date: Jun 2003
Last Activity: 16 August 2006, 9:18 AM EDT
Location: Bombay, India
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks guys, i changed my approach and i m now using an exe.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
C Library reference error using sqrt() - will not compile. plastichead Programming 2 11-07-2010 01:05 PM
Canot find library on compile - fixing PKG_CONFIG_PATH isn't working reasonstoprefer OS X (Apple) 2 03-11-2010 12:03 PM
DBI with MySQL client library compile on Solaris photon Solaris 1 01-29-2010 02:02 AM
Compile c program on Sun Solaris OS shivu Programming 4 02-04-2009 09:58 AM
libnet does not compile on Solaris 9 eldiego UNIX for Dummies Questions & Answers 3 11-01-2005 12:45 PM



All times are GMT -4. The time now is 07:28 AM.