473,389 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,389 software developers and data experts.

Error pthread_id_np_t undeclared

60
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 11736
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
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
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.