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?










share|improve this question
























  • 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















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?










share|improve this question
























  • 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













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?










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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


















  • 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
















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












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.






share|improve this answer























  • 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













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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

























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.






share|improve this answer























  • 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

















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.






share|improve this answer























  • 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















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.






share|improve this answer














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.







share|improve this answer














share|improve this answer



share|improve this answer








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




















  • 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




















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Tonle Sap (See)

I get strange results when I access the Sqlitedatabase with Unity C# via XAMPP

Guatemaltekische Davis-Cup-Mannschaft