当我尝试编译时,我收到一个特定的错误.但是,这是不可能的,因为我使用正确的旗帜.在server.c那里有图书馆pthread.h.那么,我该如何解决链接问题呢?我正在使用Linux(Ubuntu).
make
gcc -c -Wall -Wunused -ansi -pedantic -ggdb -o Server1.o Server.c
gcc -c -Wall -Wunused -ansi -pedantic -ggdb Util.c
gcc -o Server1.exe -Wall -Wunused -ansi -pedantic -ggdb -lpthread -lm Server1.o Util.o
Server1.o: In function `main':
/home/ruggero/ruggero_fine/Server.c:1002: undefined reference to `pthread_create'
collect2: ld returned 1 exit status
make: *** [Server1.exe] Errore 1
Run Code Online (Sandbox Code Playgroud)