APUE ld: arsip tidak memiliki daftar isi file '../lib/libapue.a' untuk arsitektur x86_64

0

Saya mulai belajar APUE dan mengkompilasi kode sumber

1, mengunduh kode sumber dari Kode Sumber

2, ekstrak ke

$ pwd
/Users/me/Desktop/PubRepo/C/APUE/apue.3e

3, baca readmd

$ cat readme
Read the file called DISCLAIMER.

On Freebsd, type "gmake".
On other platforms, type "make" (as long as this is gnu make).

For FAQs, updated source code, and the lost chapter, see http://www.apuebook.com.
Please direct questions, suggestions, and bug reports to [email protected].

Steve Rago
January 2013

Saya memeriksa makeversi

$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

4, buat tetapi laporkan kesalahan:

gcc -ansi -I../include -Wall -DMACOS -D_DARWIN_C_SOURCE   -c -o sleep.o sleep.c
making intro
gcc -ansi -I../include -Wall -DMACOS -D_DARWIN_C_SOURCE  getcputc.c -o getcputc  -L../lib -lapue 
ld: archive has no table of contents file '../lib/libapue.a' for architecture x86_64
clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)
make[1]: *** [getcputc] Error 254
make: *** [all] Error 1

Saya mencari dan menemukan jawaban untuk menambahkan cp ./lib/error.c /usr/local/include/ $ cp ./lib/error.c / usr / local / include /

bersihkan dan bersihkan

making intro
gcc -ansi -I../include -Wall -DMACOS -D_DARWIN_C_SOURCE  getcputc.c -o getcputc  -L../lib -lapue 
ld: archive has no table of contents file '../lib/libapue.a' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [getcputc] Error 1
make: *** [all] Error 1

Kesalahan masih ada.

Bagaimana saya bisa mendaftar apue.h?

Aljabar
sumber
Apa versi od macOS dan Xcode yang Anda miliki? (Ini berfungsi untuk Sierra / kode 8) tanpa ada perubahan dari mana Anda mendapatkan perubahan?
Tandai
macOS Mojave dan baris perintah terbaru tanpa Xcode. @ Mark
Aljabar