fatal error: pthread.h: No such file or directory
up vote
0
down vote
favorite
I'm using macbook and terminal compiling gcc version 4.8.1. I solve some problem like:
fatal error ~~~~ No such file or directory
by adding such files in compile path myself. As far, those error was resolved by finding in finder application and add in root directory /usr/local/include/c++/4.8.1 myself.
But pthread.h does not exist at all my computer.
How can I get that header file?
linux macos gcc compiler-errors pthreads
add a comment |
up vote
0
down vote
favorite
I'm using macbook and terminal compiling gcc version 4.8.1. I solve some problem like:
fatal error ~~~~ No such file or directory
by adding such files in compile path myself. As far, those error was resolved by finding in finder application and add in root directory /usr/local/include/c++/4.8.1 myself.
But pthread.h does not exist at all my computer.
How can I get that header file?
linux macos gcc compiler-errors pthreads
GCC 4.8 is kind of old and unsupported. Maybe you should consider a newer compiler. LLVM Clang is often a good choice for OS X machines. Also see GitHub | build-llvm.
– jww
Nov 19 at 18:42
The standard gcc way of getting the correct path forpthread.h(and to get the correct corresponding library) is to use the-pthreadoption on the command line.
– Gil Hamilton
Nov 19 at 19:03
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm using macbook and terminal compiling gcc version 4.8.1. I solve some problem like:
fatal error ~~~~ No such file or directory
by adding such files in compile path myself. As far, those error was resolved by finding in finder application and add in root directory /usr/local/include/c++/4.8.1 myself.
But pthread.h does not exist at all my computer.
How can I get that header file?
linux macos gcc compiler-errors pthreads
I'm using macbook and terminal compiling gcc version 4.8.1. I solve some problem like:
fatal error ~~~~ No such file or directory
by adding such files in compile path myself. As far, those error was resolved by finding in finder application and add in root directory /usr/local/include/c++/4.8.1 myself.
But pthread.h does not exist at all my computer.
How can I get that header file?
linux macos gcc compiler-errors pthreads
linux macos gcc compiler-errors pthreads
edited Nov 19 at 18:39
jww
52.1k37213479
52.1k37213479
asked Nov 19 at 15:56
cp3
24
24
GCC 4.8 is kind of old and unsupported. Maybe you should consider a newer compiler. LLVM Clang is often a good choice for OS X machines. Also see GitHub | build-llvm.
– jww
Nov 19 at 18:42
The standard gcc way of getting the correct path forpthread.h(and to get the correct corresponding library) is to use the-pthreadoption on the command line.
– Gil Hamilton
Nov 19 at 19:03
add a comment |
GCC 4.8 is kind of old and unsupported. Maybe you should consider a newer compiler. LLVM Clang is often a good choice for OS X machines. Also see GitHub | build-llvm.
– jww
Nov 19 at 18:42
The standard gcc way of getting the correct path forpthread.h(and to get the correct corresponding library) is to use the-pthreadoption on the command line.
– Gil Hamilton
Nov 19 at 19:03
GCC 4.8 is kind of old and unsupported. Maybe you should consider a newer compiler. LLVM Clang is often a good choice for OS X machines. Also see GitHub | build-llvm.
– jww
Nov 19 at 18:42
GCC 4.8 is kind of old and unsupported. Maybe you should consider a newer compiler. LLVM Clang is often a good choice for OS X machines. Also see GitHub | build-llvm.
– jww
Nov 19 at 18:42
The standard gcc way of getting the correct path for
pthread.h (and to get the correct corresponding library) is to use the -pthread option on the command line.– Gil Hamilton
Nov 19 at 19:03
The standard gcc way of getting the correct path for
pthread.h (and to get the correct corresponding library) is to use the -pthread option on the command line.– Gil Hamilton
Nov 19 at 19:03
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Use this command:
gcc -I/usr/local/include/c++/4.8.1/... myfile.c -o myfile
-I indicate gcc to take include file from this specified path.
No I mean i have no pthread.h file in my local.
– cp3
Nov 19 at 17:39
sudo apt-get install linux-headers try this it may help :)
– Susheel Dwivedi
Nov 19 at 18:29
I did sudo brew install linux-headers. But it says brew does not support this
– cp3
Nov 19 at 18:49
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Use this command:
gcc -I/usr/local/include/c++/4.8.1/... myfile.c -o myfile
-I indicate gcc to take include file from this specified path.
No I mean i have no pthread.h file in my local.
– cp3
Nov 19 at 17:39
sudo apt-get install linux-headers try this it may help :)
– Susheel Dwivedi
Nov 19 at 18:29
I did sudo brew install linux-headers. But it says brew does not support this
– cp3
Nov 19 at 18:49
add a comment |
up vote
0
down vote
Use this command:
gcc -I/usr/local/include/c++/4.8.1/... myfile.c -o myfile
-I indicate gcc to take include file from this specified path.
No I mean i have no pthread.h file in my local.
– cp3
Nov 19 at 17:39
sudo apt-get install linux-headers try this it may help :)
– Susheel Dwivedi
Nov 19 at 18:29
I did sudo brew install linux-headers. But it says brew does not support this
– cp3
Nov 19 at 18:49
add a comment |
up vote
0
down vote
up vote
0
down vote
Use this command:
gcc -I/usr/local/include/c++/4.8.1/... myfile.c -o myfile
-I indicate gcc to take include file from this specified path.
Use this command:
gcc -I/usr/local/include/c++/4.8.1/... myfile.c -o myfile
-I indicate gcc to take include file from this specified path.
edited Nov 19 at 18:38
jww
52.1k37213479
52.1k37213479
answered Nov 19 at 16:56
Susheel Dwivedi
514
514
No I mean i have no pthread.h file in my local.
– cp3
Nov 19 at 17:39
sudo apt-get install linux-headers try this it may help :)
– Susheel Dwivedi
Nov 19 at 18:29
I did sudo brew install linux-headers. But it says brew does not support this
– cp3
Nov 19 at 18:49
add a comment |
No I mean i have no pthread.h file in my local.
– cp3
Nov 19 at 17:39
sudo apt-get install linux-headers try this it may help :)
– Susheel Dwivedi
Nov 19 at 18:29
I did sudo brew install linux-headers. But it says brew does not support this
– cp3
Nov 19 at 18:49
No I mean i have no pthread.h file in my local.
– cp3
Nov 19 at 17:39
No I mean i have no pthread.h file in my local.
– cp3
Nov 19 at 17:39
sudo apt-get install linux-headers try this it may help :)
– Susheel Dwivedi
Nov 19 at 18:29
sudo apt-get install linux-headers try this it may help :)
– Susheel Dwivedi
Nov 19 at 18:29
I did sudo brew install linux-headers. But it says brew does not support this
– cp3
Nov 19 at 18:49
I did sudo brew install linux-headers. But it says brew does not support this
– cp3
Nov 19 at 18:49
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378357%2ffatal-error-pthread-h-no-such-file-or-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
GCC 4.8 is kind of old and unsupported. Maybe you should consider a newer compiler. LLVM Clang is often a good choice for OS X machines. Also see GitHub | build-llvm.
– jww
Nov 19 at 18:42
The standard gcc way of getting the correct path for
pthread.h(and to get the correct corresponding library) is to use the-pthreadoption on the command line.– Gil Hamilton
Nov 19 at 19:03