1. 程式人生 > >編譯壓縮代碼 MFCompress-src-1.01 :對‘***’未定義的引用

編譯壓縮代碼 MFCompress-src-1.01 :對‘***’未定義的引用

included procs 下載 function 遇到 start fse fun tin

提示

MFCompressD.o:在函數‘main’中:
MFCompressD.c:(.text.startup+0x34a): 警告: the use of `tempnam‘ is dangerous, better use `mkstemp‘
MFCompressD.o:在函數‘DecodeSeqBlock’中:
MFCompressD.c:(.text+0x149):對‘GetInfoPModelIdx’未定義的引用
MFCompressD.c:(.text+0x20c):對‘GetPModelIdx4’未定義的引用
MFCompressD.c:(.text+0x335):對‘GetPModelIdx4’未定義的引用
MFCompressD.c:(.text+0x366):對‘GetPModelIdxAux4’未定義的引用
MFCompressD.c:(.text+0x3dc):對‘GetPModelIdxAux4’未定義的引用
MFCompressD.c:(.text+0x461):對‘GetInfoPModelIdx’未定義的引用
MFCompressD.c:(.text+0x561):對‘GetPModelIdx2’未定義的引用

解決方法 重新編譯

gcc -c -O2 -Wall -D_FILE_OFFSET_BITS=64 -o fcm.o fcm.c -fgnu89-inline

為何這樣?

gcc -c -O2 -Wall -D_FILE_OFFSET_BITS=64 -o MFCompressD.o MFCompressD.c

出警告
In file included from MFCompressD.c:40:0:
fcm.h:164:13: warning: inline function ‘GetInfoPModelIdx’ declared but never defined
inline void GetInfoPModelIdx(Symbol *symbolPtr, CModel *cModel);
^~~~~~~~~~~~~~~~
fcm.h:162:13: warning: inline function ‘GetPModelIdxAux4’ declared but never defined
inline void GetPModelIdxAux4(Symbol *symbolPtr, CModel *cModel,
^~~~~~~~~~~~~~~~
fcm.h:160:13: warning: inline function ‘GetPModelIdx4’ declared but never defined
inline void GetPModelIdx4(Symbol *symbolPtr, CModel *cModel,
^~~~~~~~~~~~~
fcm.h:159:13: warning: inline function ‘GetPModelIdx2’ declared but never defined
inline void GetPModelIdx2(Symbol *symbolPtr, CModel *cModel);

gcc編譯時遇到“inline function ‘***‘ declared but never defined"問題

在編譯時添加選項 “-fgnu89-inline”,重新編譯即可。

註意不是在“make”後面添加“-fgnu89-inline”,是在Makefile裏在使用gcc編譯的地方添加“-fgnu89-inline”。

最後

gcc -o main MFCompressD.o mem.o fasta.o fcm.o io.o bitio.o arith.o arith_aux.o -lm

MFCompressD.o:在函數‘main’中:
MFCompressD.c:(.text.startup+0x34a): 警告: the use of `tempnam‘ is dangerous, better use `mkstemp‘

運行 結果

*@*:~/下載/壓縮/MFCompress-src-1.01$ ./main
Usage: MFCompressD [ -o MultiFastaFile ]
[ -v (verbose) ]
[ -V (verbose) ]
[ -t maxProcs (def 2) ]
[ -r recordRange (i:j or i) ]
[ -i (display file info) ]
EncodedFile
*@*:~/下載/壓縮/MFCompress-src-1.01$ ^C

源碼在此

https://files.cnblogs.com/files/marklove/MFCompress-src-1.01.tgz.zip

編譯壓縮代碼 MFCompress-src-1.01 :對‘***’未定義的引用