- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- aCC compiler and libraries
Operating System - HP-UX
1752568
Members
5442
Online
108788
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО07-07-2003 06:17 AM
тАО07-07-2003 06:17 AM
aCC compiler and libraries
We are using message Queue libraries(libmqm) for linking to an executable, which is compiled by aCC compiler. Usually We will link the messageQ library as follows:
aCC -o main main.cc -L/tools/rp56/lib -lmqm .
Under /tools/rp56/lib, We have one shared library and one archive libary of the same name. ie; libmqm.sl and libmqm.a .
1) How can I make sure that while linking with -l option it will pick up archive ?
2) Is there any default setting like, it will always pick up shared one first?
3) If there is a default setting, What is the option for picking up the other one?
Can anybody throw some light on this ?
aCC -o main main.cc -L/tools/rp56/lib -lmqm .
Under /tools/rp56/lib, We have one shared library and one archive libary of the same name. ie; libmqm.sl and libmqm.a .
1) How can I make sure that while linking with -l option it will pick up archive ?
2) Is there any default setting like, it will always pick up shared one first?
3) If there is a default setting, What is the option for picking up the other one?
Can anybody throw some light on this ?
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2003 06:38 AM
тАО07-07-2003 06:38 AM
Re: aCC compiler and libraries
You can use the +A argument to aCC to instruct ACC that all -l references are archive libraries but if you want to use both archive and shared librararies then you need to pass the -a archive_shared option to the linker phase of aCC. -a archive_shared tell ld to look first for archived libraries but if not found use the shared version.
Man aCC, ld for details.
Man aCC, ld for details.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2003 06:43 AM
тАО07-07-2003 06:43 AM
Re: aCC compiler and libraries
If both an archive and shared version of a particular library reside in the same directory, the linker links in the shared version by default. You can override this behavior with the -a linker option.
NOTE: You can use the +A option if you are using only archive libraries to create a completely archived executable.
The -a linker option tells the linker which type of library to use. The -a option is positional and applies to all subsequent libraries specified with the -l option until the end of the command line or until the next -a option is encountered. Pass the -a option to the linker with the -Wx,args option.
The following example directs the linker to use the archive version of the library libshape, followed by standard shared libraries if they exist; otherwise select archive versions.
aCC box.o sphere.o -Wl,-a,archive -lshape -Wl,-a,default
NOTE: You can use the +A option if you are using only archive libraries to create a completely archived executable.
The -a linker option tells the linker which type of library to use. The -a option is positional and applies to all subsequent libraries specified with the -l option until the end of the command line or until the next -a option is encountered. Pass the -a option to the linker with the -Wx,args option.
The following example directs the linker to use the archive version of the library libshape, followed by standard shared libraries if they exist; otherwise select archive versions.
aCC box.o sphere.o -Wl,-a,archive -lshape -Wl,-a,default
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2003 07:07 AM
тАО07-07-2003 07:07 AM
Re: aCC compiler and libraries
You can also force archive for one library by using
-l:libmqrn.a
That can be less trouble-prone when most libraries should be using shared libraries.
-l:libmqrn.a
That can be less trouble-prone when most libraries should be using shared libraries.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP