每個人。首先,我想說我對編程知之甚少。我正在嘗試在 Mac 上為我的博士學位運行一個軟體。我按照步驟編譯軟體,它們很簡單:我只需要添加正確的目錄,然后執行命令 make,因為這是目標檔案夾中的 makefile。但是,我不斷收到錯誤訊息
clang:錯誤:聯結器命令失敗,退出代碼為 1(使用 -v 查看呼叫)
這是我輸入 make 時的終端顯示:
p-oz-nb030mc:Match pferreira$ make
c -O4 -c match.cc -o match.o -Wall -g
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
c -O4 -c normalize.cc -o normalize.o -Wall -g
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
In file included from normalize.cc:35:
./series.hh:67:14: warning: unused function 'intervalmap' [-Wunused-function]
static float intervalmap(float i1b, float i1e, float i2b,
^
1 warning generated.
c match.o series.o config.o normalize.o floatnan.o -o match
ld: warning: ignoring file series.o, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x4C 0x01 0x1C 0x00 0x00 0x00 0x00 0x00 0xA4 0x74 0x08 0x00 0x92 0x00 0x00 0x00 )
ld: warning: ignoring file config.o, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x4C 0x01 0x0D 0x00 0x00 0x00 0x00 0x00 0x3A 0x44 0x05 0x00 0x5F 0x00 0x00 0x00 )
ld: warning: ignoring file floatnan.o, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x4C 0x01 0x0A 0x00 0x00 0x00 0x00 0x00 0x22 0x2F 0x02 0x00 0x28 0x00 0x00 0x00 )
Undefined symbols for architecture arm64:
"read_gapfile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
getseries(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, float, float, int, floatnan, floatnan, std::__1::vector<floatnan, std::__1::allocator<floatnan> >, std::__1::vector<floatnan, std::__1::allocator<floatnan> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in match.o
"read_tiefile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:
_main in match.o
"merge_signal_series(std::__1::vector<series, std::__1::allocator<series> >&)", referenced from:
getseries(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, float, float, int, floatnan, floatnan, std::__1::vector<floatnan, std::__1::allocator<floatnan> >, std::__1::vector<floatnan, std::__1::allocator<floatnan> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in match.o
"readfile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
getseries(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, float, float, int, floatnan, floatnan, std::__1::vector<floatnan, std::__1::allocator<floatnan> >, std::__1::vector<floatnan, std::__1::allocator<floatnan> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in match.o
"as_string(float)", referenced from:
series::lookup_label(int, float) in match.o
"as_string(int)", referenced from:
write_new_series(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, path&, series&, series&, int) in match.o
series::build_labelmap() in match.o
series::lookup_label(int, float) in match.o
"as_string(unsigned int)", referenced from:
gaps::apply_gaps(series&) in match.o
"config::read(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
_main in match.o
"config::write(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:
_main in match.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [match] Error 1
這是制作檔案:
VERSION=2.3
all: match
%: %.o
c $^ -o $@ $(LDFLAGS)
.cc.o:
# c -c $< -o $@ -Wall -g $(CFLAGS)
c -O4 -c $< -o $@ -Wall -g $(CFLAGS)
match: match.o series.o config.o normalize.o floatnan.o
match.o: match.cc config.hh series.hh normalize.hh floatnan.hh
series.o: series.cc series.hh floatnan.hh
config.o: config.cc config.hh floatnan.hh
normalize.o: normalize.cc normalize.hh series.hh floatnan.hh
floatnan.o: floatnan.cc floatnan.hh
clean:
rm -f *.o match *~ match.exe match.log *.new xmatch score_matrix
tar:
sed '/\S/ ! d;s/^/Match-${VERSION}\//' ../manifest > ../manifest.tmp
tar -cz -C ../.. -f ../match-${VERSION}.tgz -T ../manifest.tmp
check-manifest:
cd .. && find . -type f | sed 's/^.\///' | grep -v ,v | sort > manifest.tmp
sort ../manifest > ../manifest.tmp1
diff ../manifest.tmp1 ../manifest.tmp; true
pwd | grep 'Match-${VERSION}/' > /dev/null || (echo version mismatch; false)
有沒有人知道發生了什么?我沒有制作這個檔案,我只需要運行它。我從這里下載了 2.3.1 版本:https ://lorraine-lisiecki.com/match.html
我在網上搜索了錯誤,但我無法修復它。
謝謝您的幫助
uj5u.com熱心網友回復:
makefile 要求鏈接五個目標檔案以創建目標二進制檔案“ match”。它包含適用于從同一目錄中存在的相應 C 源檔案構建所有這些規則的規則。
make輸出僅顯示在嘗試鏈接最終目標之前正在構建的兩個目標檔案。這告訴我其他三個目標檔案所期望的名稱的檔案已經存在,并且它們不比相應的源更舊。這些與聯結器拒絕的三個相同。因此,您下載的源代碼包似乎包含一些不適合您的機器的預構建目標檔案。他們的加入可能是偶然的。
makefile 還包含一個clean目標,該目標應該洗掉錯誤的目標檔案等。你可以跑來make clean觸發它。運行make或make all之后再次運行。我不能向你保證構建會成功,但至少你不應該遇到同樣的問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/530195.html
