You will have to use -pthread
option explicitly for using POSIX -thread
library.
Here is the command to compile your program.
gcc -Wall program.c -o program -pthread
More Related Contents:
- What is the equivalent to Posix popen() in the Win32 API?
- POSIX API call to list all the pthreads running in a process
- Are there any platforms where using structure copy on an fd_set (for select() or pselect()) causes problems?
- How can I convert a file pointer ( FILE* fp ) to a file descriptor (int fd)?
- Is a Linux executable “compatible” with OS X?
- How to get the current time in milliseconds from C in Linux?
- Linux/POSIX equivalent for Win32’s CreateEvent, SetEvent, WaitForSingleObject
- Linux shared memory: shmget() vs mmap()?
- Checking if errno != EINTR: what does it mean?
- How to know if a Linux system call is restartable or not?
- Build OpenVPN with specific OpenSSL version
- Memory layout of C program
- Retrieve filename from file descriptor in C
- Tentative definitions in C and linking
- Why is malloc not “using up” the memory on my computer?
- How to capture Control+D signal?
- How to know what the ‘errno’ means?
- building a .so that is also an executable
- How to detect the launching of programs on Linux?
- What are .a and .so files?
- Disable variable-length automatic arrays in gcc
- Create statically-linked binary that uses getaddrinfo?
- When to use pthread condition variables?
- How to get file creation date in Linux?
- Redirect stdout to a file
- Is there an equivalent to WinAPI’s MAX_PATH under linux/unix?
- Pipes, dup2 and exec()
- Difference between C standard library and C POSIX library
- library not found for -lrt with QtCreator [mac os]
- How to print exact value of the program counter in C