I would like to use getpid
function from headers sys/types.h, unistd.h (C style) when I am using -std=c++11 flag but after that I have :
"function getpid could not be resolved".
Is there is some kind of workaround or equivalent function?
@Edit:
I check it one more time and it is not flag fault
head.h
#ifndef HEAD_H_
#define HEAD_H_
#include <sys/types.h>
#include <unistd.h>
void test();
#endif /* HEAD_H_ */
head.cpp
#include "head.h"
void test()
{
pid_t pid = getpid(); // Function 'getpid' could not be resolved
}
and this is weird because I also make test on "clean" project and there was no problem at all.
main.cpp
#include <sys/types.h>
#include <unistd.h>
int main()
{
pid_t pid = getpid();
return 0;
}
It looks like I am not able to get any function from unistd, because
char* a_cwd = getcwd(NULL,0);
is also unresolved