- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Difference between using pthread and lpthread
Operating System - HP-UX
1821537
Members
2470
Online
109633
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
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
Go to solution
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
тАО11-18-2004 05:23 AM
тАО11-18-2004 05:23 AM
When I compile a third party C application with a -lpthread in the LIB environment variable everything runs fine. But if I use just the -pthread in the LIB environment varible then I receive an error 68 at runtime.
Is there any difference between these libraries ? And any reason that HPUX ships both these ?
Is there any difference between these libraries ? And any reason that HPUX ships both these ?
Solved! Go to Solution.
- Tags:
- pthread
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-18-2004 09:59 PM
тАО11-18-2004 09:59 PM
Re: Difference between using pthread and lpthread
Hi,
When compile with -lpthread it links with the libpthread lib,
when you compile with -pthread
it is cc -p -thread
So the it is not the right syntax.
When compile with -lpthread it links with the libpthread lib,
when you compile with -pthread
it is cc -p -thread
So the it is not the right syntax.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-19-2004 03:01 AM
тАО11-19-2004 03:01 AM
Solution
Hi
From
http://www.aero.lr.tudelft.nl/facilities/manuals/ansic/threads.html#RN.CVT.NN586
Accessing the Pthreads Library
Pthreads (POSIX threads) refers to the Pthreads library of thread-management routines. For information on Pthread routines see the pthread(3t) man page.
To use the Pthread routines, your program must include the header file and the Pthreads library must be explicitly linked to your program. For example:
% cc -D_POSIX_C_SOURCE+199506L prog.c -lpthread
The -D_POSIX_C_SOURCE=199506L string specifies the appropriate POSIX revision level. In this case, the level is 199506L.
So -l tells the compiler to use pthread
It is not seperate
Steve STeel
From
http://www.aero.lr.tudelft.nl/facilities/manuals/ansic/threads.html#RN.CVT.NN586
Accessing the Pthreads Library
Pthreads (POSIX threads) refers to the Pthreads library of thread-management routines. For information on Pthread routines see the pthread(3t) man page.
To use the Pthread routines, your program must include the
% cc -D_POSIX_C_SOURCE+199506L prog.c -lpthread
The -D_POSIX_C_SOURCE=199506L string specifies the appropriate POSIX revision level. In this case, the level is 199506L.
So -l tells the compiler to use pthread
It is not seperate
Steve STeel
If you want truly to understand something, try to change it. (Kurt Lewin)
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.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP