- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How Do I create a Shared library
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2004 11:24 AM
тАО10-12-2004 11:24 AM
I would like to create a shared library from the C Objects as well as C++.
I am using bundled C compiler that comes with the operating system and gcc compiler version 3.4.2 from GNU.
Let's say I have two C programs. One with one function and another with functions.
I would to create a shared library for the above.
Similarly Let's say I have two C++ programs like above How do I create a shared library.
Let's say I have
a.c with functions void func1() ,void func2()
b.c with functions void func3()
I want to create a shared library from the above as libab.so or libab.sl
Thank you,
Any help appreciated,
Vinay
Solved! Go to Solution.
- Tags:
- shlib
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2004 08:59 PM
тАО10-12-2004 08:59 PM
Solutioncc/aCC : (cc = ansi C compiler, not bundled)
cc -b a.c b.c -o libab.so
aCC -b a.c b.c -o libab.so
the gcc line is probably:
gcc -fpic -shared a.c b.c -o libab.so
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2004 01:09 AM
тАО10-13-2004 01:09 AM
Re: How Do I create a Shared library
Thank you,
vinay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2004 05:45 PM
тАО10-13-2004 05:45 PM
Re: How Do I create a Shared library
http://www.hp.com/go/gcc
for cc/aCC it is "+DD64"
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2004 06:48 PM
тАО10-13-2004 06:48 PM
Re: How Do I create a Shared library
# cc -O +Z -c file_a.c
# cc -O +Z -c file_b.c
# ld -b -o files.sl file_a.o file_b.o
# cc -O +Z -o test -L. -lfiles test.c
# gcc -O -fPIC -c file_a.c
# gcc -O -fPIC -c file_b.c
# ld -b -o files.sl file_a.o file_b.o
# gcc -O -fPIC -o test -L. -lfiles test.c
I don't have an Itanium here, but I've build perl on on of HP's testdrive systems, where I noted that Itanium, other than pa-risc, can use gcc to build both 32bit (default) and 64bit (-mlp64) objects. On pa-risc machines you need two different compilers for 32 and 64bitness
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2004 08:41 PM
тАО10-13-2004 08:41 PM
Re: How Do I create a Shared library
getting them to emit non-PIC code is not easy.
also, PA32 cc understands "-b" means "+z" - PA32 aCC doesnt, they are fixing that.
building c++ libraries by using ld directly is discouraged. it leads to problems most of the time.
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2004 09:41 PM
тАО10-13-2004 09:41 PM
Re: How Do I create a Shared library
no points please
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2004 12:37 AM
тАО10-14-2004 12:37 AM