473,473 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Error pthread_id_np_t undeclared

60 New Member
Dear team,

I am using posix thread and I downloaded example that I want to test. However the compile complains that:
`pthread_id_np_t' was not declared in this scope

I have done:
#include <pthread.h>
and I compile as follow:

g++ -pthread example.cxx

How I can solve this problem?
Nov 22 '07 #1
3 11747
mohammadazim
28 New Member
Dear team,

I am using posix thread and I downloaded example that I want to test. However the compile complains that:
`pthread_id_np_t' was not declared in this scope

I have done:
#include <pthread.h>
and I compile as follow:

g++ -pthread example.cxx

How I can solve this problem?
if you want to use thread then you can use pthread_t instead of `pthread_id_np_t'. Then do a pthread_create to create it.

instead downloading some code try downloading some tute and try yourself.

Secondly, while specifing pthread library while compiling it should be -lpthread. That is -l<libname>. Or if you are on Ubunto or some other platform that don't need 'l' to identify a library then it is fine.
Nov 22 '07 #2
seforo
60 New Member
First of all I know how to use pthread_t and I want to know why the compiler does not recognize pthread_id_np_t.
Secondly there is some import behavior I want to observe from that code and reuse it. I don't have to reinvent the wheel.
Thirdly posix thread are compiled with -pthread (http://www.llnl.gov/computing/tutorials/pthreads/)
Nov 22 '07 #3
mohammadazim
28 New Member
First of all I know how to use pthread_t and I want to know why the compiler does not recognize pthread_id_np_t.
Secondly there is some import behavior I want to observe from that code and reuse it. I don't have to reinvent the wheel.
Thirdly posix thread are compiled with -pthread (http://www.llnl.gov/computing/tutorials/pthreads/)
Sorry I thought you never used pthread.

Here is valuable quote that I found on http://publib.boulder.ibm.com/infoce...s/users_23.htm

"The i5/OS machine implementation of threads provides a 64-bit thread ID. The thread ID is returned as a structure containing the high and low order 4 bytes of the 64-bit ID. This allows applications created by compilers that do not yet support 64-bit integral values to effectively use the 64-bit thread ID.
"

May be it is our platform which do not support pthread_id_np_t and saw pthread.h and other headers in /usr/include/ and this pthread_id_np_t is no where declared.

I wrote a simple code including pthread.h and tried to use pthread_id_np_t and it gave me the same error.
Nov 23 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Materialised | last post by:
I am having some issues with the following code, basically what I am trying to do, is familierise myself with compiler warnings, when I try to access a private or protected class function. Here is...
13
by: developer | last post by:
re-compile under dev -c++ bloodshed. can u help ? #include<dos.h> #include<process.h> #include<io.h> #include<stdio.h> #define STROBE 0x01
5
by: cranium.2003 | last post by:
hi, Here is my code #include <iostream.h> int main() { cout <<"HI"; return 0; } and using following command to compile a C++ program g++ ex1.cpp -o ex1
2
by: teddybyte | last post by:
my script below is: #include "stdafx.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, ...
4
by: Jon Rea | last post by:
I have the following code that works on Visual C++ 2005 and on GCC. bool VectorContains( const std::vector<int>& vect, int value ) { std::vector<int>::const_iterator iter; for( iter =...
1
by: jrefran | last post by:
Hi everyone! I have problem on my DBD:Oracle installation from source code. Does anyone familiar with this kind of error. Please help! I'm completely new with this kind of work item. This is the...
25
by: notahipee | last post by:
I have been trying to cin an number from 0 to 9 with a leading 0. For example 00 or 07. I was using a switch case. switch (int) { case 01: break; case 02: break;..... My problem arises at 08...
4
by: VikrantS | last post by:
Hi, I am migrating code from VS 6.0 to VS2008. The Code compiles in VS 6.0 but gives the following errors when compiled in VS 2008, --- \Program Files\VC\atlmfc\include\afxcmn.inl(376) : error...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.