Score:0

Facing issues when trying to compile the pthread.c my Ubuntu 22.04 via vs code terminal

tm flag

I have installed pthread using this command in my vs code terminal--> sudo apt-get install libpthread-stubs0-dev

When I try to compile the pthread.c file I am getting below error message. Here pthread.c is the file name.

gcc –g –Wall –pthread pthread.c –o pt
/usr/bin/ld: cannot find –g: No such file or directory
/usr/bin/ld: cannot find –Wall: No such file or directory
/usr/bin/ld: cannot find –pthread: No such file or directory
/usr/bin/ld: cannot find –o: No such file or directory
/usr/bin/ld: cannot find pt: No such file or directory
collect2: error: ld returned 1 exit status

I have installed mpi using this command in my vs code terminal--> sudo apt install openmpi-bin

For MPI I am getting error for #include <mpi.h>. Below is the error message.

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/root/mpi.c).C/C++(1696)

When I try to compile the mpi.c file I am getting below error message. Here mpi.c is the file name.

mpicc –g –Wall –o mpi mpi.c
mpi.c:2:10: fatal error: mpi.h: No such file or directory
    2 | #include <mpi.h>
      |          ^~~~~~~

Below is my env details.

 ~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy
hr flag
In the first case (`gcc –g –Wall –pthread pthread.c –o pt`) it is almost certainly because your command uses the [unicode en dash](https://unicode-table.com/en/2013/) in place of the ASCII hyphen character
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.